From patchwork Wed Aug 12 16:00:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 40915 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7CFwLLZ005478 for ; Wed, 12 Aug 2009 15:58:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754054AbZHLP5e (ORCPT ); Wed, 12 Aug 2009 11:57:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754044AbZHLP5d (ORCPT ); Wed, 12 Aug 2009 11:57:33 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42778 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754024AbZHLP5c (ORCPT ); Wed, 12 Aug 2009 11:57:32 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7CFvXqn005608; Wed, 12 Aug 2009 11:57:33 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7CFvW0U004599; Wed, 12 Aug 2009 11:57:32 -0400 Received: from localhost.localdomain (dhcp-1-31.tlv.redhat.com [10.35.1.31]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7CFvFCN029667; Wed, 12 Aug 2009 11:57:30 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH v2 11/11] KVM test: make stress_boot work properly with TAP networking Date: Wed, 12 Aug 2009 19:00:03 +0300 Message-Id: <85008502cab1e7e58447f56c1c1bc1e033045e9f.1250091576.git.mgoldish@redhat.com> In-Reply-To: <0df7966e6378b54be138c866c39f2d1e58c67333.1250091576.git.mgoldish@redhat.com> References: <1250092803-32477-1-git-send-email-mgoldish@redhat.com> <10a541e518180735e86a4dbc8e759912d0ec314c.1250091576.git.mgoldish@redhat.com> <42ceeed70c7c1ec9f4d78d91d67a290f3ac11e6e.1250091576.git.mgoldish@redhat.com> <8284ff0173612b63412132bb8c864f2c8a258b55.1250091576.git.mgoldish@redhat.com> <05eac6f84757616309273b01ac4d8800efbdb083.1250091576.git.mgoldish@redhat.com> <5fbc30f0d24e3d4b12b93f40fe14264e5963048c.1250091576.git.mgoldish@redhat.com> <40e596a8c1d099f0afdd2ad18f2f4a0908b89f20.1250091576.git.mgoldish@redhat.com> <71ae342fd706695b8670fe549b7aa7222a284586.1250091576.git.mgoldish@redhat.com> <0df7966e6378b54be138c866c39f2d1e58c67333.1250091576.git.mgoldish@redhat.com> In-Reply-To: <10a541e518180735e86a4dbc8e759912d0ec314c.1250091576.git.mgoldish@redhat.com> References: <10a541e518180735e86a4dbc8e759912d0ec314c.1250091576.git.mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Take an additional parameter 'clone_address_index_base' which indicates the initial value for 'address_index' for the cloned VMs. This value is incremented after each clone is created. I assume the original VM has a single NIC; otherwise NICs will end up sharing MAC addresses, which is bad. Also, make a few small corrections: - Take the params for the clones from the original VM's params, not from the test's params, because the test's params contain information about several VMs, only one of which is the original VM. The original VM's params, on the other hand, describe just a single VM (which we want to clone). - Change the way kill_vm.* parameters are sent to the postprocessor. (The postprocessor doesn't read params from the VM objects but rather from the test's params dict.) - Replace 'if get_command_status(...)' with 'if get_command_status(...) != 0'. - Replace the test command 'ps aux' with 'uname -a'. The silly reason for this is that DSL-4.2.5 doesn't like 'ps aux'. Since 'uname -a' is just as good (AFAIK), use it instead. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_tests.cfg.sample | 7 ++++++- client/tests/kvm/kvm_tests.py | 14 ++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/tests/kvm/kvm_tests.cfg.sample b/client/tests/kvm/kvm_tests.cfg.sample index 255716a..a8ba6b3 100644 --- a/client/tests/kvm/kvm_tests.cfg.sample +++ b/client/tests/kvm/kvm_tests.cfg.sample @@ -117,7 +117,12 @@ variants: - stress_boot: install setup type = stress_boot max_vms = 5 - alive_test_cmd = ps aux + alive_test_cmd = uname -a + clone_address_index_base = 10 + kill_vm = yes + kill_vm_vm1 = no + kill_vm_gracefully = no + extra_params += " -snapshot" - shutdown: install setup type = shutdown diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py index 4bc8718..d146929 100644 --- a/client/tests/kvm/kvm_tests.py +++ b/client/tests/kvm/kvm_tests.py @@ -541,8 +541,8 @@ def run_stress_boot(tests, params, env): raise error.TestFail("Could not log into first guest") num = 2 - vms = [] sessions = [session] + address_index = int(params.get("clone_address_index_base", 10)) # boot the VMs while num <= int(params.get("max_vms")): @@ -550,15 +550,12 @@ def run_stress_boot(tests, params, env): vm_name = "vm" + str(num) # clone vm according to the first one - vm_params = params.copy() - vm_params['image_snapshot'] = "yes" - vm_params['kill_vm'] = "yes" - vm_params['kill_vm_gracefully'] = "no" + vm_params = vm.get_params().copy() + vm_params["address_index"] = str(address_index) curr_vm = vm.clone(vm_name, vm_params) kvm_utils.env_register_vm(env, vm_name, curr_vm) params['vms'] += " " + vm_name - #vms.append(curr_vm) logging.info("Booting guest #%d" % num) if not curr_vm.create(): raise error.TestFail("Cannot create VM #%d" % num) @@ -571,10 +568,11 @@ def run_stress_boot(tests, params, env): sessions.append(curr_vm_session) # check whether all previous ssh sessions are responsive - for i, vm_session in enumerate(sessions): - if vm_session.get_command_status(params.get("alive_test_cmd")): + for i, se in enumerate(sessions): + if se.get_command_status(params.get("alive_test_cmd")) != 0: raise error.TestFail("Session #%d is not responsive" % i) num += 1 + address_index += 1 except (error.TestFail, OSError): for se in sessions: