From patchwork Sun Aug 2 23:58:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 38809 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 n72Nsrwb009553 for ; Sun, 2 Aug 2009 23:54:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753912AbZHBXyu (ORCPT ); Sun, 2 Aug 2009 19:54:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753869AbZHBXyu (ORCPT ); Sun, 2 Aug 2009 19:54:50 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37214 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860AbZHBXyt (ORCPT ); Sun, 2 Aug 2009 19:54:49 -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 n72NrwwA016622; Sun, 2 Aug 2009 19:54:09 -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 n72Nrl0S022153; Sun, 2 Aug 2009 19:53:47 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n72Nre6K017975; Sun, 2 Aug 2009 19:53:46 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 04/12] KVM test: add host-specific MAC-IP pool configuration Date: Mon, 3 Aug 2009 02:58:13 +0300 Message-Id: <3e87b54663c4483d10912231945fc37741087b8f.1249257056.git.mgoldish@redhat.com> In-Reply-To: <30ddf2ae0b04eb29d55dcece97fd956b75563045.1249257056.git.mgoldish@redhat.com> References: <1249257501-19337-1-git-send-email-mgoldish@redhat.com> <7845d2fd228ec0232af10e48dbb29e1076a265d6.1249257056.git.mgoldish@redhat.com> <9ec0626f3ca8c20d08cfd2448dbf249632ed969a.1249257056.git.mgoldish@redhat.com> <30ddf2ae0b04eb29d55dcece97fd956b75563045.1249257056.git.mgoldish@redhat.com> In-Reply-To: <7845d2fd228ec0232af10e48dbb29e1076a265d6.1249257056.git.mgoldish@redhat.com> References: <7845d2fd228ec0232af10e48dbb29e1076a265d6.1249257056.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