From patchwork Fri May 28 08:25:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 102834 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4S8K3A7019315 for ; Fri, 28 May 2010 08:20:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756301Ab0E1IUA (ORCPT ); Fri, 28 May 2010 04:20:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10007 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754534Ab0E1IT6 (ORCPT ); Fri, 28 May 2010 04:19:58 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4S8JvjR030475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 May 2010 04:19:58 -0400 Received: from dhcp-91-25.nay.redhat.com (dhcp-91-25.nay.redhat.com [10.66.91.25]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4S8JtbF029920; Fri, 28 May 2010 04:19:56 -0400 Subject: [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation To: lmr@redhat.com, autotest@test.kernel.org From: Jason Wang Cc: kvm@vger.kernel.org Date: Fri, 28 May 2010 16:25:09 +0800 Message-ID: <20100528082509.31543.671.stgit@dhcp-91-25.nay.redhat.com> In-Reply-To: <20100528082501.31543.64111.stgit@dhcp-91-25.nay.redhat.com> References: <20100528082501.31543.64111.stgit@dhcp-91-25.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 28 May 2010 08:20:05 +0000 (UTC) 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()