From patchwork Wed Oct 29 10:41:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 39750 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 5274224073 for ; Wed, 29 Oct 2014 10:42:52 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id x13sf1515210wgg.1 for ; Wed, 29 Oct 2014 03:42:51 -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=hC9kgkG3vgrwCTUyaCnXnNj5wNx0r3+xbbp5zm0AVAc=; b=daEA/Bg3plDYbctrm8zvOPSRUvmZkgfO6IioWzTYW/OJCzudwy5e2oXVqKGsl933Ld KzKsx/tbse3L6voLrP0Qrl9dUV0wVtdFEmdZERVj2COwlPITX6UgTd9yqqO/36b3s9ve 1Vg1vJlM4mYxAIBc53IJSc9NNBprtMJJMjse4B752iE2KK1PoO8IRbaMaC1FqRnuh2V2 H16V5Uvl9Nrk9p7/japOwO1TefNo4icbEFQ/J5YaPwX5CSxG1VPBb8OEfH9FB8pASO7t U1lcmrD2dCWiXRTTijFeJuPXzzIbxJ8sztR6WbzpQ4IpIYmpee3+IqSvkm3Eya2pLIrx t6yg== X-Gm-Message-State: ALoCoQmnAFl4lSoEu7KjqAZeeD6EF6uumj6AHls7D8f3tlL9YwxWGtyQH/QqwW7TBLoy853y8E6B X-Received: by 10.112.225.135 with SMTP id rk7mr1598282lbc.6.1414579371529; Wed, 29 Oct 2014 03:42:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.99 with SMTP id i3ls195376laa.79.gmail; Wed, 29 Oct 2014 03:42:51 -0700 (PDT) X-Received: by 10.152.18.166 with SMTP id x6mr10308766lad.18.1414579371357; Wed, 29 Oct 2014 03:42:51 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id y8si6591485lag.85.2014.10.29.03.42.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Oct 2014 03:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id ge10so2261175lab.2 for ; Wed, 29 Oct 2014 03:42:51 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr10237636lbb.74.1414579371267; Wed, 29 Oct 2014 03:42:51 -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 c5csp633470lbz; Wed, 29 Oct 2014 03:42:50 -0700 (PDT) X-Received: by 10.224.125.7 with SMTP id w7mr14431309qar.62.1414579368013; Wed, 29 Oct 2014 03:42:48 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id s7si6726630qak.86.2014.10.29.03.42.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Oct 2014 03:42:48 -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 1XjQhV-0002Ti-70; Wed, 29 Oct 2014 10:42:01 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XjQhS-0002Ow-Fl for xen-devel@lists.xen.org; Wed, 29 Oct 2014 10:41:58 +0000 Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id 3B/E4-02952-574C0545; Wed, 29 Oct 2014 10:41:57 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1414579315!13388912!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.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14680 invoked from network); 29 Oct 2014 10:41:56 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 29 Oct 2014 10:41:56 -0000 X-IronPort-AV: E=Sophos;i="5.04,809,1406592000"; d="scan'208";a="186004737" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Wed, 29 Oct 2014 06:41:53 -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 1XjQhM-00014h-IH; Wed, 29 Oct 2014 10:41:53 +0000 Received: by zakaz.uk.xensource.com (sSMTP sendmail emulation); Wed, 29 Oct 2014 10:41:52 +0000 From: Ian Campbell To: Date: Wed, 29 Oct 2014 10:41:32 +0000 Message-ID: <1414579302-6692-10-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1414579268.29975.13.camel@citrix.com> References: <1414579268.29975.13.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH OSSTEST v2 10/20] 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.43 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 Signed-off-by: Ian Campbell --- v2: Set HostGroup props after DB Clarify docs --- Osstest/HostDB/Static.pm | 2 ++ Osstest/TestSupport.pm | 19 ++++++++++++++++++- README | 22 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/Osstest/HostDB/Static.pm b/Osstest/HostDB/Static.pm index e786761..076da62 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..a1c2947 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -766,7 +766,15 @@ 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}); @@ -775,6 +783,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 5c5f347..5ba695d 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