From patchwork Tue Jun 17 15:26:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32064 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E74C7206A0 for ; Tue, 17 Jun 2014 15:27:51 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id dc16sf22708696qab.9 for ; Tue, 17 Jun 2014 08:27: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=S5A+gwrKzBUK9h+2geJYAb8Juu/0KZ+F2AsELIUPNSg=; b=T/rQy7+9vIMT2oG0HZITO2MU99Hb1DCTm5ikZqKc2a5vdkLhbmV2xFUXSNU9zQfmfQ xNoCFSj2j2YPnE9l5DqVSNmqg1ECjZzXW0L9i6cNuyoESMBxgdRhe6GJGsTdpajjN4Nq xbCxJmBjw8tHv287GmAZI/ddn5xcY8Lc+PQ7XNtNJREwsO0+B9Lq9SjV0q8Tn4ojKA07 bYvuwDfLtWiq3/0PclLZWnvaEf50DK/KWgICYhC6t1p0dXpOnki6nbPEfAMYx4WKclTu zYJrHamx3kZ3936wM0C3fL6Kd1vhSZRBoEoF4RlZVfAQjZgNUfgip4kt8ozqsz9VGkdt v//Q== X-Gm-Message-State: ALoCoQldvkZ4MDSaAoX4g8/1ayzkWuoSqgmLw4yP5MHDI01Qb/cLn7dMctT48Yxq1d2lvIYyMpSS X-Received: by 10.58.115.234 with SMTP id jr10mr352020veb.19.1403018871788; Tue, 17 Jun 2014 08:27:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.7 with SMTP id 7ls4918660qgo.60.gmail; Tue, 17 Jun 2014 08:27:51 -0700 (PDT) X-Received: by 10.221.29.137 with SMTP id ry9mr22588551vcb.6.1403018871664; Tue, 17 Jun 2014 08:27:51 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id n9si5603051vcx.91.2014.06.17.08.27.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:27:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jx11so4968184veb.19 for ; Tue, 17 Jun 2014 08:27:51 -0700 (PDT) X-Received: by 10.52.246.42 with SMTP id xt10mr18605860vdc.5.1403018871580; Tue, 17 Jun 2014 08:27: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.221.54.6 with SMTP id vs6csp217968vcb; Tue, 17 Jun 2014 08:27:51 -0700 (PDT) X-Received: by 10.140.81.74 with SMTP id e68mr16252006qgd.77.1403018871090; Tue, 17 Jun 2014 08:27:51 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w3si17315691qas.67.2014.06.17.08.27.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:27:51 -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 1WwvHQ-0005vv-KQ; Tue, 17 Jun 2014 15:26:36 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwvHO-0005rf-Fo for xen-devel@lists.xen.org; Tue, 17 Jun 2014 15:26:34 +0000 Received: from [193.109.254.147:59679] by server-10.bemta-14.messagelabs.com id D6/45-04546-92E50A35; Tue, 17 Jun 2014 15:26:33 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1403018788!11897229!5 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 20018 invoked from network); 17 Jun 2014 15:26:32 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Jun 2014 15:26:32 -0000 X-IronPort-AV: E=Sophos;i="5.01,494,1400025600"; d="scan'208";a="144521700" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 17 Jun 2014 15:26:29 +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:28 -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 1WwvHH-00010a-Ib; Tue, 17 Jun 2014 16:26:27 +0100 From: Ian Campbell To: Date: Tue, 17 Jun 2014 16:26:21 +0100 Message-ID: <1403018787-25442-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.128.174 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;