kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: lmr@redhat.com, autotest@test.kernel.org
Cc: kvm@vger.kernel.org
Subject: [PATCH 2/3] KVM test: Do not use the hard-coded address during	unattended installation
Date: Fri, 28 May 2010 16:25:09 +0800	[thread overview]
Message-ID: <20100528082509.31543.671.stgit@dhcp-91-25.nay.redhat.com> (raw)
In-Reply-To: <20100528082501.31543.64111.stgit@dhcp-91-25.nay.redhat.com>

When we do the unattended installation in tap mode, we should use
vm.get_address() instead of the 'localhost' in order the connect to
the finish program running in the guest.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 client/tests/kvm/tests/unattended_install.py |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py
index e2cec8e..8928575 100644
--- a/client/tests/kvm/tests/unattended_install.py
+++ b/client/tests/kvm/tests/unattended_install.py
@@ -17,7 +17,6 @@ def run_unattended_install(test, params, env):
     vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
 
     port = vm.get_port(int(params.get("guest_port_unattended_install")))
-    addr = ('localhost', port)
     if params.get("post_install_delay"):
         post_install_delay = int(params.get("post_install_delay"))
     else:
@@ -31,17 +30,19 @@ def run_unattended_install(test, params, env):
     time_elapsed = 0
     while time_elapsed < install_timeout:
         client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        try:
-            client.connect(addr)
-            msg = client.recv(1024)
-            if msg == 'done':
-                if post_install_delay:
-                    logging.debug("Post install delay specified, "
-                                  "waiting %ss...", post_install_delay)
-                    time.sleep(post_install_delay)
-                break
-        except socket.error:
-            pass
+        addr = vm.get_address()
+        if addr is not None:
+            try:
+                client.connect((addr, port))
+                msg = client.recv(1024)
+                if msg == 'done':
+                    if post_install_delay:
+                        logging.debug("Post install delay specified, "
+                                      "waiting %ss...", post_install_delay)
+                        time.sleep(post_install_delay)
+                    break
+            except socket.error:
+                pass
         time.sleep(1)
         client.close()
         end_time = time.time()

  reply	other threads:[~2010-05-28  8:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28  8:25 [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm Jason Wang
2010-05-28  8:25 ` Jason Wang [this message]
2010-05-28  8:25 ` [PATCH 3/3] KVM test: Add implementation of network based unattended installation Jason Wang
  -- strict thread matches above, loose matches on Subject: below --
2010-05-19  9:20 [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm Jason Wang
2010-05-19  9:20 ` [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation Jason Wang
2010-05-26 13:58   ` Lucas Meneghel Rodrigues
2010-05-28  8:20     ` Jason Wang

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=20100528082509.31543.671.stgit@dhcp-91-25.nay.redhat.com \
    --to=jasowang@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).