From patchwork Wed Aug 12 15:59:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 40908 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 n7CFwLLS005478 for ; Wed, 12 Aug 2009 15:58:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754027AbZHLP5Z (ORCPT ); Wed, 12 Aug 2009 11:57:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754018AbZHLP5Y (ORCPT ); Wed, 12 Aug 2009 11:57:24 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42760 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754012AbZHLP5W (ORCPT ); Wed, 12 Aug 2009 11:57:22 -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 n7CFvNQS005520; Wed, 12 Aug 2009 11:57:23 -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 n7CFvM5A004543; Wed, 12 Aug 2009 11:57:22 -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 n7CFvFCG029667; Wed, 12 Aug 2009 11:57:21 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH v2 04/11] KVM test: add host-specific MAC-IP pool configuration Date: Wed, 12 Aug 2009 18:59:56 +0300 Message-Id: In-Reply-To: <8284ff0173612b63412132bb8c864f2c8a258b55.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> 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 - Add kvm_address_pools.cfg which specifies a set of MAC-IP ranges for each host. - Read kvm_address_pools.cfg in the control file and filter it by hostname, so that each host uses only the MAC addresses assigned to it. If the hostname doesn't match any hostname in kvm_address_pools.cfg, use 'default_host'. - While we're at it, add a comment informing the user where to modify the test configration, if that is desirable - (Also add a missing space somewhere in the control file, and remove a few extra ones) Signed-off-by: Michael Goldish --- client/tests/kvm/control | 25 +++++++++-- client/tests/kvm/kvm_address_pools.cfg.sample | 56 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 client/tests/kvm/kvm_address_pools.cfg.sample diff --git a/client/tests/kvm/control b/client/tests/kvm/control index 5c5d424..2ad8d81 100644 --- a/client/tests/kvm/control +++ b/client/tests/kvm/control @@ -133,12 +133,27 @@ if not r: import kvm_config filename = os.path.join(pwd, "kvm_tests.cfg") -list = kvm_config.config(filename).get_list() +cfg = kvm_config.config(filename) + +# If desirable, make changes to the test configuration here. For example: +# cfg.parse_string("only fc8_quick") +# cfg.parse_string("display = sdl") + +filename = os.path.join(pwd, "kvm_address_pools.cfg") +if os.path.exists(filename): + cfg.parse_file(filename) + hostname = os.uname()[1].split(".")[0] + if cfg.filter("^" + hostname): + cfg.parse_string("only ^%s" % hostname) + else: + cfg.parse_string("only ^default_host") + +list = cfg.get_list() -# ------------- -# Run the tests -# ------------- +# ------------- +# Run the tests +# ------------- status_dict = {} for dict in list: @@ -153,7 +168,7 @@ for dict in list: dependencies_satisfied = False break if dependencies_satisfied: - test_iterations=int(dict.get("iterations", 1)) + test_iterations = int(dict.get("iterations", 1)) current_status = job.run_test("kvm", params=dict, tag=dict.get("shortname"), iterations=test_iterations) diff --git a/client/tests/kvm/kvm_address_pools.cfg.sample b/client/tests/kvm/kvm_address_pools.cfg.sample new file mode 100644 index 0000000..8a27ee1 --- /dev/null +++ b/client/tests/kvm/kvm_address_pools.cfg.sample @@ -0,0 +1,56 @@ +# Rename this file to kvm_address_pools.cfg. +# This file specifies several MAC-IP ranges for each host in the network that +# may run KVM tests. A MAC address must not be used twice, so these ranges +# must not overlap. The VMs running on each host will only use MAC addresses +# from the pool of that host. +# If you wish to use a static MAC-IP mapping, where each MAC address range is +# mapped to a known corresponding IP address range, specify the bases of the IP +# address ranges in this file. + +variants: + # Rename host1 to an actual (short) hostname in the network that will be running the Autotest client + - @host1: + # Add/remove ranges here + address_ranges = r1 r2 + + # Modify the following parameters to reflect the DHCP server's configuration + address_range_base_mac_r1 = 52:54:00:12:35:56 + #address_range_base_ip_r1 = 10.0.2.20 + address_range_size_r1 = 16 + + # Modify the following parameters to reflect the DHCP server's configuration + address_range_base_mac_r2 = 52:54:00:12:35:80 + #address_range_base_ip_r2 = 10.0.2.40 + address_range_size_r2 = 16 + + # Rename host2 to an actual (short) hostname in the network that will be running the Autotest client + - @host2: + # Add/remove ranges here + address_ranges = r1 r2 + + # Modify the following parameters to reflect the DHCP server's configuration + address_range_base_mac_r1 = 52:54:00:12:36:56 + #address_range_base_ip_r1 = 10.0.3.20 + address_range_size_r1 = 16 + + # Modify the following parameters to reflect the DHCP server's configuration + address_range_base_mac_r2 = 52:54:00:12:36:80 + #address_range_base_ip_r2 = 10.0.3.40 + address_range_size_r2 = 16 + + # Add additional hosts here... + + # This will be used for hosts that do not appear on the list + - @default_host: + # Add/remove ranges here + address_ranges = r1 r2 + + # Modify the following parameters to reflect the DHCP server's configuration + address_range_base_mac_r1 = 52:54:00:12:34:56 + #address_range_base_ip_r1 = 10.0.1.20 + address_range_size_r1 = 16 + + # Modify the following parameters to reflect the DHCP server's configuration + address_range_base_mac_r2 = 52:54:00:12:34:80 + #address_range_base_ip_r2 = 10.0.1.40 + address_range_size_r2 = 16