From patchwork Fri Nov 21 13:16:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 41302 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E86E6244B0 for ; Fri, 21 Nov 2014 13:18:40 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf2997372wgh.1 for ; Fri, 21 Nov 2014 05:18:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=PkDgzBJXGyq0NmDEhErWRmPR9rIddfegn+CKC0v3oWk=; b=J+8L2RgwSUoKEBI6Zp1Keiu707MpnAkHi90LArbqjqbLpb6oprRx412NDLi3KjYep/ Z4DLkQ1v5BbT0FYbeW+R9brQ1lANDEte/LnfkXQJ1o4kJztWrOC4fNWARJabxP9plE7V /zovM2tPhCpTkxPb2MMkAZGR4VWDxNGuVkiKoBppLkvOB/80qxtxbpGR+8iewfliGpzk UhGJCyEFeh2hNzYVOJa7CgzfIybj0sSUlOXKJFCS9x+JAm6f25D3lF1mTo9dJwW1wM85 gPt/GVbdHQke2ZIt65rXQK0SqXhgHFxgYdI8H+c/T9dLDCmkupSEWQ8cukuGVGlJN08G 9cdA== X-Gm-Message-State: ALoCoQnjezHd7IIV/rmb29ABxH/JUbhoPZ3ToSU47kC3A4iX7S2xpCKFhveq8xA++RCD6tEk/uqc X-Received: by 10.181.12.37 with SMTP id en5mr11050717wid.6.1416575919695; Fri, 21 Nov 2014 05:18:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.193 with SMTP id l1ls213347laa.79.gmail; Fri, 21 Nov 2014 05:18:38 -0800 (PST) X-Received: by 10.152.36.74 with SMTP id o10mr3354100laj.96.1416575918935; Fri, 21 Nov 2014 05:18:38 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id ln11si5409137lac.4.2014.11.21.05.18.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 05:18:36 -0800 (PST) Received-SPF: temperror (google.com: error in processing during lookup of patch+caf_=patchwork-forward=linaro.org@linaro.org: DNS timeout) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so2984995lbv.14 for ; Fri, 21 Nov 2014 05:18:36 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr4493736lbo.32.1416575916792; Fri, 21 Nov 2014 05:18:36 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp87129lbc; Fri, 21 Nov 2014 05:18:35 -0800 (PST) X-Received: by 10.52.9.74 with SMTP id x10mr3800875vda.16.1416575914892; Fri, 21 Nov 2014 05:18:34 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 4si2275522vdi.34.2014.11.21.05.18.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Nov 2014 05:18:34 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xro5I-0007Fr-9U; Fri, 21 Nov 2014 13:17:12 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xro5G-0007FZ-RD for xen-devel@lists.xen.org; Fri, 21 Nov 2014 13:17:11 +0000 Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id B8/57-02696-55B3F645; Fri, 21 Nov 2014 13:17:09 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1416575827!13996777!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28202 invoked from network); 21 Nov 2014 13:17:08 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 21 Nov 2014 13:17:08 -0000 X-IronPort-AV: E=Sophos;i="5.07,431,1413244800"; d="scan'208";a="193695861" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 21 Nov 2014 08:17:06 -0500 Received: from kazak.uk.xensource.com ([10.80.2.80] helo=zakaz.uk.xensource.com) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1Xro5A-0003AR-Qa; Fri, 21 Nov 2014 13:17:05 +0000 Received: by zakaz.uk.xensource.com (sSMTP sendmail emulation); Fri, 21 Nov 2014 13:17:04 +0000 From: Ian Campbell To: Date: Fri, 21 Nov 2014 13:16:50 +0000 Message-ID: <1416575824-15555-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1416505070.26869.2.camel@citrix.com> References: <1416505070.26869.2.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH OSSTEST v3 01/15] standalone: Introduce "HostGroups" for use in OSSTEST_CONFIG X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=temperror (google.com: error in processing during lookup of patch+caf_=patchwork-forward=linaro.org@linaro.org: DNS timeout) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This saves repeating identical HostProp and HostFlags for sets of identical machines. e.g. HostGroupProp_cubietruck_LinuxSerialConsole ttyS0 HostGroupProp_cubietruck_Build_Make_Flags -j12 HostGroupProp_cubietruck_XenSerialConsole dtuart HostGroupProp_cubietruck_XenDTUARTPath /soc@01c00000/serial@01c28000 HostGroupFlags_cubietruck suite-wheezy,equiv-cubietruck,need-kernel-deb-armmp,no-di-kernel,need-uboot-bootscr HostGroup_braque cubietruck HostProp_braque_Fqdn braque.uk.xensource.com HostGroup_picaso cubietruck HostProp_picaso_Fqdn picaso.uk.xensource.com HostGroup_metzinger cubietruck HostProp_metzinger metzinger.uk.xensource.com HostGroup_gleizes cubietruck HostProp_gleizes_Fqdn gleizes.uk.xensource.com Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v3: Simplify lookup of HostGroup_FOO v2: Set HostGroup props after DB Clarify docs --- Osstest/HostDB/Static.pm | 2 ++ Osstest/TestSupport.pm | 17 ++++++++++++++++- README | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Osstest/HostDB/Static.pm b/Osstest/HostDB/Static.pm index d0c13a1..ad18395 100644 --- a/Osstest/HostDB/Static.pm +++ b/Osstest/HostDB/Static.pm @@ -58,6 +58,8 @@ sub get_flags ($$) { #method }; $process->('HostFlags'); + $process->("HostGroupFlags_$ho->{Properties}{HostGroup}") + if $ho->{Properties}{HostGroup}; $process->("HostFlags_$ho->{Name}"); return $flags; diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 46b6720..a3b6936 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -767,7 +767,13 @@ sub selecthost ($) { $ho->{Properties}{$pn} = $val; }; - # First, we use the config file's general properites as defaults + # First, set the prop group if any. + if ( $c{"HostGroup_${name}"} ) { + $setprop->("HostGroup", $c{"HostGroup_${name}"}); + logm("Host $name is in HostGroup $ho->{Properties}{HostGroup}"); + } + + # Next, we use the config file's general properites as defaults foreach my $k (keys %c) { next unless $k =~ m/^HostProp_([A-Z].*)$/; $setprop->($1, $c{$k}); @@ -776,6 +782,15 @@ sub selecthost ($) { # Then we read in the HostDB's properties $mhostdb->get_properties($name, $ho->{Properties}); + # Next, we set any HostGroup based properties + if ( $ho->{Properties}{HostGroup} ) { + foreach my $k (keys %c) { + next unless $k =~ m/^HostGroupProp_([-a-z0-9]+)_(.*)$/; + next unless $1 eq $ho->{Properties}{HostGroup}; + $setprop->($2, $c{$k}); + } + } + # Finally, we override any host-specific properties from the config foreach my $k (keys %c) { next unless $k =~ m/^HostProp_([-a-z0-9]+)_(.*)$/; diff --git a/README b/README index 9a85549..1226369 100644 --- a/README +++ b/README @@ -333,6 +333,28 @@ HostProp__TftpScope Defines the Tftp scope (i.e. subnet) where this host resides. See "TftpFoo_ and TftpFoo" below. +HostFlags_ + Defines a set of flags for the host. Flags is a list separated by + whitespace, comma or semi-colon. A flag can be unset by prepending + a !. Only used in standalone mode. + +HostGroup_ + Defines a group of similar hosts of which is a + member. This can then be used with HostGroupProp and HostGroupFlags + +HostGroupProps__ + Equivalent to writing HostProp__ for every testbox + which declares HostGroup__. Allows setting a set of + common properties for a group of similar machines. These settings + take precedence over the database provided settings, but are + themselves overridden by host-specific properties. + +HostGroupFlags_ + Equivalent to writing HostFlags_ for every testbox which + declares HostGroup__. Allows setting a set of + common flags for a group of similar machines. These flags are + merged with the host specific flags. Only used in standalone mode. + DebianPreseed Text to add to the debian-installer preseed file. Optional but you will need to set some NTP servers here if your firewall