Re: [PATCH] KVM test: Parallel install of guest OS v3

2010-03-17 Thread Lucas Meneghel Rodrigues
FYI, patch applied, see:

http://autotest.kernel.org/changeset/4309

On Wed, Mar 17, 2010 at 11:28 PM, Lucas Meneghel Rodrigues
 wrote:
> From: yogi 
>
> The patch enables doing mulitple install of guest OS in parallel.
> Have added four more options to  test_base.cfg, port redirection
> entry "guest_port_unattend_shell" for host to communicate with
> guest during installation, "pxe_dir", 'pxe_image' and
> 'pxe_initrd" to specify locations for kernel and initrd.
> For parallel installation to work in unattended mode, the floppy
> image and pxe boot path also  has to be unique for each quest.
>
> All the relevant unattended post install steps for guests were
> changed, now they are server based codes.
>
> Notes:
>  * Yogi, I am going to remove the SLES patch, and will wait for
> you to send a new patchset with both the SLES files and the
> opensuse ones, OK? Thanks.
>
> Changes from v2:
>  * According to Michael Goldish comments, handled a possible
> socket.error exception that could be generated during the
> unattended install test
>  * Modified the floppy image names to be contained inside
> the same directory that might hold the tftp root for each
> OS, making the needed changes on unattended.py.
>  * Added floppy names for windows based OSs, which were lacking
> on previous patches.
>
> Changes from v1:
>  * Fixed the logic for the new unattended install test (original
> implementation would hang indefinitely if guest dies in the middle
> of the install).
>  * Fixed the config changes to make sure the unattended install
> port actually gets redirected so the test can work, also made the
> config specific to unattended install
>  * Merged the finish.exe patch, including a binary patch that
> changes the binary shipped to the new version
>  * Changed all unattended install files to use the parallel
> mechanism
>
> Tested with Windows 7 and Fedora 11 guests. I (lmr) am going to
> keep this in the queue for a bit so I can test it more in the
> internal test farm and everybody can take a look at the patch.
>
> Signed-off-by: Yogananth Subramanian 
> Signed-off-by: Lucas Meneghel Rodrigues 
> ---
>  client/tests/kvm/deps/finish.cpp                   |  111 
> +++-
>  client/tests/kvm/deps/finish.exe                   |  Bin 26913 -> 26926 
> bytes
>  client/tests/kvm/kvm_utils.py                      |    4 +-
>  client/tests/kvm/scripts/unattended.py             |   59 ++-
>  client/tests/kvm/tests/unattended_install.py       |   45 
>  client/tests/kvm/tests_base.cfg.sample             |   81 +--
>  client/tests/kvm/unattended/Fedora-10.ks           |   12 +-
>  client/tests/kvm/unattended/Fedora-11.ks           |   11 +-
>  client/tests/kvm/unattended/Fedora-12.ks           |   11 +-
>  client/tests/kvm/unattended/Fedora-8.ks            |   11 +-
>  client/tests/kvm/unattended/Fedora-9.ks            |   11 +-
>  client/tests/kvm/unattended/RHEL-3-series.ks       |   12 +-
>  client/tests/kvm/unattended/RHEL-4-series.ks       |   11 +-
>  client/tests/kvm/unattended/RHEL-5-series.ks       |   11 +-
>  client/tests/kvm/unattended/win2003-32.sif         |    2 +-
>  client/tests/kvm/unattended/win2003-64.sif         |    2 +-
>  .../kvm/unattended/win2008-32-autounattend.xml     |    2 +-
>  .../kvm/unattended/win2008-64-autounattend.xml     |    2 +-
>  .../kvm/unattended/win2008-r2-autounattend.xml     |    2 +-
>  .../tests/kvm/unattended/win7-32-autounattend.xml  |    2 +-
>  .../tests/kvm/unattended/win7-64-autounattend.xml  |    2 +-
>  .../kvm/unattended/winvista-32-autounattend.xml    |    2 +-
>  .../kvm/unattended/winvista-64-autounattend.xml    |    2 +-
>  client/tests/kvm/unattended/winxp32.sif            |    2 +-
>  client/tests/kvm/unattended/winxp64.sif            |    2 +-
>  25 files changed, 242 insertions(+), 170 deletions(-)
>
> diff --git a/client/tests/kvm/deps/finish.cpp 
> b/client/tests/kvm/deps/finish.cpp
> index 9c2867c..e5ba128 100644
> --- a/client/tests/kvm/deps/finish.cpp
> +++ b/client/tests/kvm/deps/finish.cpp
> @@ -1,12 +1,13 @@
> -// Simple app that only sends an ack string to the KVM unattended install
> -// watch code.
> +// Simple application that creates a server socket, listening for connections
> +// of the unattended install test. Once it gets a client connected, the
> +// app will send back an ACK string, indicating the install process is done.
>  //
>  // You must link this code with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
>  //
>  // Author: Lucas Meneghel Rodrigues 
>  // Code was adapted from an MSDN sample.
>
> -// Usage: finish.exe [Host OS IP]
> +// Usage: finish.exe
>
>  // MinGW's ws2tcpip.h only defines getaddrinfo and other functions only for
>  // the case _WIN32_WINNT >= 0x0501.
> @@ -21,24 +22,18 @@
>  #include 
>  #include 
>
> -#define DEFAULT_BUFLEN 512
>  #define DEFAULT_PORT "12323"
> -
>  int main(int argc, char **argv)
>  {
>     WSADATA wsaData;
> -    SOCKET ConnectSocket = INVALID_SOCKET;
> -    

[PATCH] KVM test: Parallel install of guest OS v3

2010-03-17 Thread Lucas Meneghel Rodrigues
From: yogi 

The patch enables doing mulitple install of guest OS in parallel.
Have added four more options to  test_base.cfg, port redirection
entry "guest_port_unattend_shell" for host to communicate with
guest during installation, "pxe_dir", 'pxe_image' and
'pxe_initrd" to specify locations for kernel and initrd.
For parallel installation to work in unattended mode, the floppy
image and pxe boot path also  has to be unique for each quest.

All the relevant unattended post install steps for guests were
changed, now they are server based codes.

Notes:
 * Yogi, I am going to remove the SLES patch, and will wait for
you to send a new patchset with both the SLES files and the
opensuse ones, OK? Thanks.

Changes from v2:
 * According to Michael Goldish comments, handled a possible
socket.error exception that could be generated during the
unattended install test
 * Modified the floppy image names to be contained inside
the same directory that might hold the tftp root for each
OS, making the needed changes on unattended.py.
 * Added floppy names for windows based OSs, which were lacking
on previous patches.

Changes from v1:
 * Fixed the logic for the new unattended install test (original
implementation would hang indefinitely if guest dies in the middle
of the install).
 * Fixed the config changes to make sure the unattended install
port actually gets redirected so the test can work, also made the
config specific to unattended install
 * Merged the finish.exe patch, including a binary patch that
changes the binary shipped to the new version
 * Changed all unattended install files to use the parallel
mechanism

Tested with Windows 7 and Fedora 11 guests. I (lmr) am going to
keep this in the queue for a bit so I can test it more in the
internal test farm and everybody can take a look at the patch.

Signed-off-by: Yogananth Subramanian 
Signed-off-by: Lucas Meneghel Rodrigues 
---
 client/tests/kvm/deps/finish.cpp   |  111 +++-
 client/tests/kvm/deps/finish.exe   |  Bin 26913 -> 26926 bytes
 client/tests/kvm/kvm_utils.py  |4 +-
 client/tests/kvm/scripts/unattended.py |   59 ++-
 client/tests/kvm/tests/unattended_install.py   |   45 
 client/tests/kvm/tests_base.cfg.sample |   81 +--
 client/tests/kvm/unattended/Fedora-10.ks   |   12 +-
 client/tests/kvm/unattended/Fedora-11.ks   |   11 +-
 client/tests/kvm/unattended/Fedora-12.ks   |   11 +-
 client/tests/kvm/unattended/Fedora-8.ks|   11 +-
 client/tests/kvm/unattended/Fedora-9.ks|   11 +-
 client/tests/kvm/unattended/RHEL-3-series.ks   |   12 +-
 client/tests/kvm/unattended/RHEL-4-series.ks   |   11 +-
 client/tests/kvm/unattended/RHEL-5-series.ks   |   11 +-
 client/tests/kvm/unattended/win2003-32.sif |2 +-
 client/tests/kvm/unattended/win2003-64.sif |2 +-
 .../kvm/unattended/win2008-32-autounattend.xml |2 +-
 .../kvm/unattended/win2008-64-autounattend.xml |2 +-
 .../kvm/unattended/win2008-r2-autounattend.xml |2 +-
 .../tests/kvm/unattended/win7-32-autounattend.xml  |2 +-
 .../tests/kvm/unattended/win7-64-autounattend.xml  |2 +-
 .../kvm/unattended/winvista-32-autounattend.xml|2 +-
 .../kvm/unattended/winvista-64-autounattend.xml|2 +-
 client/tests/kvm/unattended/winxp32.sif|2 +-
 client/tests/kvm/unattended/winxp64.sif|2 +-
 25 files changed, 242 insertions(+), 170 deletions(-)

diff --git a/client/tests/kvm/deps/finish.cpp b/client/tests/kvm/deps/finish.cpp
index 9c2867c..e5ba128 100644
--- a/client/tests/kvm/deps/finish.cpp
+++ b/client/tests/kvm/deps/finish.cpp
@@ -1,12 +1,13 @@
-// Simple app that only sends an ack string to the KVM unattended install
-// watch code.
+// Simple application that creates a server socket, listening for connections
+// of the unattended install test. Once it gets a client connected, the
+// app will send back an ACK string, indicating the install process is done.
 //
 // You must link this code with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
 //
 // Author: Lucas Meneghel Rodrigues 
 // Code was adapted from an MSDN sample.
 
-// Usage: finish.exe [Host OS IP]
+// Usage: finish.exe
 
 // MinGW's ws2tcpip.h only defines getaddrinfo and other functions only for
 // the case _WIN32_WINNT >= 0x0501.
@@ -21,24 +22,18 @@
 #include 
 #include 
 
-#define DEFAULT_BUFLEN 512
 #define DEFAULT_PORT "12323"
-
 int main(int argc, char **argv)
 {
 WSADATA wsaData;
-SOCKET ConnectSocket = INVALID_SOCKET;
-struct addrinfo *result = NULL,
-*ptr = NULL,
-hints;
+SOCKET ListenSocket = INVALID_SOCKET, ClientSocket = INVALID_SOCKET;
+struct addrinfo *result = NULL, hints;
 char *sendbuf = "done";
-char recvbuf[DEFAULT_BUFLEN];
-int iResult;
-int recvbuflen = DEFAULT_BUFLEN;
+int iRe