From patchwork Fri Oct 10 12:02:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 38569 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A5D3202DB for ; Fri, 10 Oct 2014 12:03:41 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf2028763lbv.8 for ; Fri, 10 Oct 2014 05:03:40 -0700 (PDT) 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:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=tlNel7yimXHHPTxba2kyG/j8tH62vwD+4xQZ3S4KpUE=; b=ITy1kMgjrIO2Y8aDwmuovHzsAVr81l//5OI7iGw+PuWwgg5wZbBhAk/LeJb67p6CzB VgXYM0LbjFz1v9vXkHlz8l2cXbsvqGrCrIsX6Nd5uH51FT5IC8b8Yv881s+50cAbX+Ft 2lgmPPNXLsGDBKYuOsT5Hw+X05krIpMB+S986DtOCumam2SEaVE8rWdQAzQBSnrU5uoN HMpoku35BXyv8HI1AazHP6skG9wFjFV3aO3bpGuyhcFb9AOLmaxgMjgcQE1xD8JEJoOM 5/PdXV7l2rMGMWyMezFUh74IvjM2GrkH/bBRhCAzexK4yUnYqR5cd+FM/xyjHFm3WrfK GaeA== X-Gm-Message-State: ALoCoQmoprPl6DVw1+OI+9qwExGNv6hRa8LYcqNnPvhWt9yL07RzvhVaCniMoqcvh7UzlPrXLXJ+ X-Received: by 10.112.145.136 with SMTP id su8mr869723lbb.9.1412942620131; Fri, 10 Oct 2014 05:03:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.169 with SMTP id c9ls257625laa.56.gmail; Fri, 10 Oct 2014 05:03:39 -0700 (PDT) X-Received: by 10.152.9.132 with SMTP id z4mr4535078laa.8.1412942619932; Fri, 10 Oct 2014 05:03:39 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id s7si8952574lbb.38.2014.10.10.05.03.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 05:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id q1so3086232lam.18 for ; Fri, 10 Oct 2014 05:03:39 -0700 (PDT) X-Received: by 10.112.190.69 with SMTP id go5mr4259041lbc.32.1412942619830; Fri, 10 Oct 2014 05:03:39 -0700 (PDT) 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.84.229 with SMTP id c5csp414327lbz; Fri, 10 Oct 2014 05:03:39 -0700 (PDT) X-Received: by 10.220.142.196 with SMTP id r4mr463100vcu.63.1412942618620; Fri, 10 Oct 2014 05:03:38 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id m2si9162650qai.115.2014.10.10.05.03.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 05:03:38 -0700 (PDT) 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 1XcYuI-0002Na-KU; Fri, 10 Oct 2014 12:02:50 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYuH-0002Mg-D3 for xen-devel@lists.xen.org; Fri, 10 Oct 2014 12:02:49 +0000 Received: from [85.158.143.35:62060] by server-3.bemta-4.messagelabs.com id 26/E7-06192-8EAC7345; Fri, 10 Oct 2014 12:02:48 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1412942558!11748672!4 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10349 invoked from network); 10 Oct 2014 12:02:47 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 10 Oct 2014 12:02:47 -0000 X-IronPort-AV: E=Sophos;i="5.04,691,1406592000"; d="scan'208";a="181281224" 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, 10 Oct 2014 08:02:46 -0400 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 1XcYuD-0008Tr-AV; Fri, 10 Oct 2014 13:02:46 +0100 Received: by zakaz.uk.xensource.com (sSMTP sendmail emulation); Fri, 10 Oct 2014 13:02:45 +0100 From: Ian Campbell To: Date: Fri, 10 Oct 2014 13:02:26 +0100 Message-ID: <1412942554-752-11-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412942404.27111.12.camel@citrix.com> References: <1412942404.27111.12.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH RFC OSSTEST 11/19] 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) 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 I was unsure whether HostGroupProp's ought to be processed before or after the HostDB properties, but since the latter is a NOP I've arbitrarily put them before. Signed-off-by: Ian Campbell --- Osstest/HostDB/Static.pm | 2 ++ Osstest/TestSupport.pm | 19 ++++++++++++++++++- README | 20 ++++++++++++++++++++ 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 d66708e..6901563 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -766,12 +766,29 @@ sub selecthost ($) { $ho->{Properties}{$pn} = $val; }; - # First, we use the config file's general properites as defaults + # First, set the prop group if any. + foreach my $k (keys %c) { + next unless $k =~ m/^HostGroup_([-a-z0-9]+)$/; + next unless $1 eq $name; + $setprop->("HostGroup", $c{$k}); + 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}); } + # 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}); + } + } + # Then we read in the HostDB's properties $mhostdb->get_properties($name, $ho->{Properties}); diff --git a/README b/README index 9a85549..b4f9cfb 100644 --- a/README +++ b/README @@ -333,6 +333,26 @@ 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. + +HostGroupFlags_ + Equivalent to writing HostFlags_ for every testbox which + declares HostGroup__. Allows setting a set of + common flags for a group of similar machines. 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