From patchwork Tue Jun 17 15:26:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32069 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B9B6206A0 for ; Tue, 17 Jun 2014 15:28:13 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf18546613ykq.0 for ; Tue, 17 Jun 2014 08:28:13 -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=S5A+gwrKzBUK9h+2geJYAb8Juu/0KZ+F2AsELIUPNSg=; b=b9BeEiQbE2bkBLRJTbygkR7DjSqCMO3KK/nPaAvDB7dius8QzH0m7O2fpudQMl6ycq xxEGbTSXyr8p2RrUomoM1Nus+PRgbdatmFjiLl/z5E2DDgh1fiyMFABUdYaQRwg0oKc9 gTxEcu5d/15kcqmQSoClxX3DXeEpRWaIyzOUTL3tI4AHHV7RvpLgyMp76kMet0RYp++q RsRenoK7LOAfmtw1DepcDCHj353ZzEKnY/TsXElcYYsyWol8wrq7CSxUDpZ6/+PomwJ8 CakcOq7HMvhJSN+h5jhb0AtR742Mo9WSxVKoqS5HoXjziCdE91HfA41kg/ka3kOksuwK iM5w== X-Gm-Message-State: ALoCoQk4narT114ierkXnWVZbbUh4nEX62QAmdQRe4m/aMaPGgOi1kCZyCIo84RYJ9Deb8R+ifm9 X-Received: by 10.58.65.38 with SMTP id u6mr513217ves.16.1403018893142; Tue, 17 Jun 2014 08:28:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.35.199 with SMTP id n65ls2173164qgn.59.gmail; Tue, 17 Jun 2014 08:28:13 -0700 (PDT) X-Received: by 10.58.195.130 with SMTP id ie2mr22299718vec.3.1403018893027; Tue, 17 Jun 2014 08:28:13 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id f17si1288375vdt.85.2014.06.17.08.28.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so6641129vcb.32 for ; Tue, 17 Jun 2014 08:28:12 -0700 (PDT) X-Received: by 10.52.26.165 with SMTP id m5mr757593vdg.93.1403018892933; Tue, 17 Jun 2014 08:28:12 -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.221.54.6 with SMTP id vs6csp217995vcb; Tue, 17 Jun 2014 08:28:12 -0700 (PDT) X-Received: by 10.50.131.167 with SMTP id on7mr42917247igb.0.1403018892305; Tue, 17 Jun 2014 08:28:12 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id t11si16914454igd.31.2014.06.17.08.28.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:28:12 -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 1WwvHr-0006Rj-FD; Tue, 17 Jun 2014 15:27:03 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwvHm-0006JK-Sb for xen-devel@lists.xen.org; Tue, 17 Jun 2014 15:26:59 +0000 Received: from [193.109.254.147:17386] by server-11.bemta-14.messagelabs.com id 07/D2-09902-24E50A35; Tue, 17 Jun 2014 15:26:58 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1403018812!11869034!3 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.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5678 invoked from network); 17 Jun 2014 15:26:57 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Jun 2014 15:26:57 -0000 X-IronPort-AV: E=Sophos;i="5.01,494,1400025600"; d="scan'208";a="144521869" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 17 Jun 2014 15:26:52 +0000 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; Tue, 17 Jun 2014 11:26:50 -0400 Received: from kazak.uk.xensource.com ([10.80.2.80] helo=kazak.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WwvHe-00010t-3W; Tue, 17 Jun 2014 16:26:50 +0100 From: Ian Campbell To: Date: Tue, 17 Jun 2014 16:26:43 +0100 Message-ID: <1403018809-25509-3-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1403018758.25074.5.camel@kazak.uk.xensource.com> References: <1403018758.25074.5.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH RFC OSSTEST 3/9] Toolstack: use get_host_method_object() to manage toolstack selection 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.220.173 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 will allow us to more easily have per-toolstack methods etc. Signed-off-by: Ian Campbell --- Osstest/TestSupport.pm | 37 ++++--------------------------------- Osstest/Toolstack/libvirt.pm | 34 ++++++++++++++++++++++++++++++++++ Osstest/Toolstack/xend.pm | 35 +++++++++++++++++++++++++++++++++++ Osstest/Toolstack/xl.pm | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+), 33 deletions(-) create mode 100644 Osstest/Toolstack/libvirt.pm create mode 100644 Osstest/Toolstack/xend.pm create mode 100644 Osstest/Toolstack/xl.pm diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 1377610..6129e9e 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1810,42 +1810,13 @@ sub guest_vncsnapshot_stash ($$$$) { target_getfile_root($ho,100, "$rfile", "$stash/$leaf"); } -our %toolstacks= - ('xend' => { - NewDaemons => [qw(xend)], - OldDaemonInitd => 'xend', - Command => 'xm', - CfgPathVar => 'cfgpath', - Dom0MemFixed => 1, - }, - 'xl' => { - NewDaemons => [], - Dom0MemFixed => 1, - Command => 'xl', - CfgPathVar => 'cfgpath', - RestoreNeedsConfig => 1, - }, - 'libvirt' => { - NewDaemons => [qw(libvirtd)], - Dom0MemFixed => 1, - Command => 'virsh', - ExtraPackages => [qw(libnl1 libavahi-client3)], - }, - ); - sub toolstack ($) { my ($ho) = @_; return $ho->{Toolstack} if $ho->{Toolstack}; - my $tsname= $r{toolstack}; - $tsname= 'xend' if !defined $tsname; - my $ts= $toolstacks{$tsname}; - die "$tsname ?" unless defined $ts; - if (!exists $ts->{Name}) { - logm("toolstack $tsname"); - $ts->{Name}= $tsname; - } - $ho->{Toolstack} = $ts; - return $ts; + + my $tsname= $r{toolstack} || 'xend'; + $ho->{Toolstack}= get_host_method_object($ho, 'Toolstack', $tsname); + return $ho->{Toolstack}; } sub authorized_keys () { diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm new file mode 100644 index 0000000..90fe434 --- /dev/null +++ b/Osstest/Toolstack/libvirt.pm @@ -0,0 +1,34 @@ +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2014 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +package Osstest::Toolstack::libvirt; + +use strict; +use warnings; + +sub new { + my ($class, $ho, $methname,$asset) = @_; + return bless { Name => "libvirt", + Host => $ho, + NewDaemons => [qw(libvirtd)], + Dom0MemFixed => 1, + Command => 'virsh', + ExtraPackages => [qw(libnl1 libavahi-client3)], + }, $class; +} + +1; diff --git a/Osstest/Toolstack/xend.pm b/Osstest/Toolstack/xend.pm new file mode 100644 index 0000000..881417d --- /dev/null +++ b/Osstest/Toolstack/xend.pm @@ -0,0 +1,35 @@ +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2014 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +package Osstest::Toolstack::xend; + +use strict; +use warnings; + +sub new { + my ($class, $ho, $methname,$asset) = @_; + return bless { Name => "xend", + Host => $ho, + NewDaemons => [qw(xend)], + OldDaemonInitd => 'xend', + Command => 'xm', + CfgPathVar => 'cfgpath', + Dom0MemFixed => 1, + }, $class; +} + +1; diff --git a/Osstest/Toolstack/xl.pm b/Osstest/Toolstack/xl.pm new file mode 100644 index 0000000..0b66201 --- /dev/null +++ b/Osstest/Toolstack/xl.pm @@ -0,0 +1,35 @@ +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2014 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +package Osstest::Toolstack::xl; + +use strict; +use warnings; + +sub new { + my ($class, $ho, $methname,$asset) = @_; + return bless { Name => "xl", + Host => $ho, + NewDaemons => [], + Dom0MemFixed => 1, + Command => 'xl', + CfgPathVar => 'cfgpath', + RestoreNeedsConfig => 1, + }, $class; +} + +1;