All of lore.kernel.org
 help / color / mirror / Atom feed
From: yogi <anantyog@linux.vnet.ibm.com>
To: autotest@test.kernel.org
Cc: kvm@vger.kernel.org
Subject: [KVM-AUTOTEST PATCH 1/5] KVM test: Support for Parallel install of guest OS
Date: Wed, 10 Feb 2010 21:58:30 +0530	[thread overview]
Message-ID: <1265819310.6747.27.camel@yogi-laptop> (raw)
In-Reply-To: <1265818995.6747.25.camel@yogi-laptop>

>From b2ddf7e9d434ea33619ced976f61e59d2d20ab71 Mon Sep 17 00:00:00 2001
From: yogananth subramanian <anantyog@linux.vnet.ibm.com>
Date: Wed, 10 Feb 2010 06:15:29 -0500
Subject: [PATCH 1/5] kvm test: unattended install: change host role from
server to client

By changing the role of the host from server to client, we can do
unattended install in parallel. Similar change has to be made in the
unattended installfile(kickstart, xml) to make them behave as server
rather as client.

Signed-off-by: yogananth subramanian <anantyog@linux.vnet.ibm.com>
---
 client/tests/kvm/tests/unattended_install.py |   38
++++++++++++-------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/client/tests/kvm/tests/unattended_install.py
b/client/tests/kvm/tests/unattended_install.py
index e3df72a..3978e26 100644
--- a/client/tests/kvm/tests/unattended_install.py
+++ b/client/tests/kvm/tests/unattended_install.py
@@ -13,11 +13,11 @@ def run_unattended_install(test, params, env):
     @param params: Dictionary with the test parameters.
     @param env: Dictionary with test environment.
     """
+    buf = 1024
     vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
 
-    server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    server.bind(('', 12323))
-    server.listen(1)
+    port = vm.get_port(int(params.get("guest_port_unattend_shell")))
+    addr = ('localhost', port)
 
     install_timeout = float(params.get("timeout", 3000))
     logging.info("Starting unattended install watch process. "
@@ -26,21 +26,19 @@ def run_unattended_install(test, params, env):
     start_time = time.time()
 
     while True:
-        server.settimeout(install_timeout)
+        client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         try:
-            (client, addr) = server.accept()
-        except socket.timeout:
-            server.close()
-            raise error.TestFail('Timeout elapsed while waiting for
install to '
-                                 'finish.')
-        msg = client.recv(1024)
-        logging.debug("Received '%s' from %s", msg, addr)
-        if msg == 'done':
-            end_time = time.time()
-            time_elapsed = int(end_time - start_time)
-            logging.info('Guest reported successful installation after
%ds '
-                         '(%d min)', time_elapsed, time_elapsed/60)
-            server.close()
-            break
-        else:
-            logging.error('Got invalid string from client: %s.' % msg)
+            client.connect(addr)
+            msg = client.recv(1024)
+            if msg == 'thank u for connecting':
+                break
+            else:
+                raise Exception
+        except:
+            time.sleep(1)
+            client.close()
+
+    end_time = time.time()
+    time_elapsed = int(end_time - start_time)
+    logging.info('Guest reported successful installation after %ds '
+                 '(%d min)', time_elapsed, time_elapsed/60)
-- 
1.6.2.5

  reply	other threads:[~2010-02-10 16:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 16:23 [Autotest] [KVM-AUTOTEST PATCH 0/5] KVM test: Support for Parallel install of guest OS yogi
2010-02-10 16:28 ` yogi [this message]
2010-02-10 16:29 ` [KVM-AUTOTEST PATCH 2/5] " yogi
2010-02-10 16:29 ` [KVM-AUTOTEST PATCH 3/5] " yogi
2010-02-10 17:09   ` Ryan Harper
2010-02-10 17:22   ` [Autotest] " Lucas Meneghel Rodrigues
2010-02-10 17:45     ` yogi
2010-02-10 16:30 ` [Autotest] [KVM-AUTOTEST PATCH 4/5] " yogi
2010-02-10 16:30 ` [KVM-AUTOTEST PATCH 5/5] " yogi
2010-02-10 17:13 ` [Autotest] [KVM-AUTOTEST PATCH 0/5] " Lucas Meneghel Rodrigues
2010-02-10 17:54   ` Ryan Harper
2010-02-10 19:41     ` Lucas Meneghel Rodrigues
2010-02-10 18:00   ` [Autotest] " yogi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265819310.6747.27.camel@yogi-laptop \
    --to=anantyog@linux.vnet.ibm.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.