From patchwork Tue Jun 17 15:26:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32074 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5DBCC206A0 for ; Tue, 17 Jun 2014 15:28:29 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rd18sf42725443iec.6 for ; Tue, 17 Jun 2014 08:28:28 -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=LTJpdIayDoHjfGcF3LkpGaSEeQNLggpaLWWicMCLD1Y=; b=iYR9JsT6qMWU7WEX2ATgPMflguLvVubqXhGkxxQxBtzFiY9vsK8SgVplJRgHagKMFp bITYAAmkssltOcQOV7z/b7Stuas49mBecavtF12/bHC3MHkIwm6x+qJKQ1VSK9+yL/+K fFCWWva5vrRrKu1ntfuvadL5QlMs+7zvFGP1dVN6Equi4ZWO8IQOOS/R8UT1PvgoEE9T vLiEVtLKv7kngubLhKNfE/ffeF4Om6ChSLvxLyAr/Tzxgx96jRzUuTMFTuBykd0oPs/C WNesxhE6otE1xh4pwFhB1YEOEapoznA8NegWmzANzyc2/SLBSe2UahJ4UFjcs595AmzN 6GVw== X-Gm-Message-State: ALoCoQnbQGUBPuDKMdP8PpcjWwnGMY51tcItA6L1MI9U+mR8WYqfbu73SYcHEjxViEiBpNBwrmC5 X-Received: by 10.182.166.36 with SMTP id zd4mr1554973obb.43.1403018908917; Tue, 17 Jun 2014 08:28:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.99 with SMTP id d90ls1223325qgf.57.gmail; Tue, 17 Jun 2014 08:28:28 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr11737929vcb.23.1403018908826; Tue, 17 Jun 2014 08:28:28 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id jb1si5609679vec.42.2014.06.17.08.28.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id il7so6717005vcb.27 for ; Tue, 17 Jun 2014 08:28:28 -0700 (PDT) X-Received: by 10.58.230.101 with SMTP id sx5mr22888273vec.10.1403018908741; Tue, 17 Jun 2014 08:28:28 -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 vs6csp218012vcb; Tue, 17 Jun 2014 08:28:28 -0700 (PDT) X-Received: by 10.58.29.234 with SMTP id n10mr22536840veh.16.1403018908430; Tue, 17 Jun 2014 08:28:28 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ir5si5605191vcb.82.2014.06.17.08.28.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:28:28 -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 1WwvHO-0005rj-4E; Tue, 17 Jun 2014 15:26:34 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwvHM-0005qN-0f for xen-devel@lists.xen.org; Tue, 17 Jun 2014 15:26:32 +0000 Received: from [85.158.139.211:60276] by server-12.bemta-5.messagelabs.com id 70/B0-27841-72E50A35; Tue, 17 Jun 2014 15:26:31 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1403018788!10468546!2 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.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30959 invoked from network); 17 Jun 2014 15:26:30 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 17 Jun 2014 15:26:30 -0000 X-IronPort-AV: E=Sophos;i="5.01,494,1400025600"; d="scan'208";a="144219446" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 17 Jun 2014 15:26:28 +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-KF; Tue, 17 Jun 2014 16:26:27 +0100 From: Ian Campbell To: Date: Tue, 17 Jun 2014 16:26:22 +0100 Message-ID: <1403018787-25442-4-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 4/9] TestSupport: always use xl for generic operations. 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.182 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: Unless the toolstack is xend (for compatibility with pre-xl Xen versions), when we use xm. For several operations in TestSupport.pm the actual toolstack isn't really relevant, since we want info straight from Xen. For simplicity just use xl (or xm) in these cases, to avoid needing to implement the following specially for each toolstack: - host_get_free_memory - guest_get_state - guest_find_domid Signed-off-by: Ian Campbell --- Osstest/TestSupport.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 6129e9e..11a036f 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -905,6 +905,13 @@ sub compress_stashed($) { #---------- other stuff ---------- +sub common_toolstack () { + my $tsname= $r{toolstack} || 'xend'; + my $ts = 'xl'; + $ts = 'xm' if $tsname eq 'xend'; + return $ts; +} + sub host_reboot ($) { my ($ho) = @_; target_reboot($ho); @@ -924,7 +931,7 @@ sub host_reboot ($) { sub host_get_free_memory($) { my ($ho) = @_; - my $toolstack = toolstack($ho)->{Command}; + my $toolstack = common_toolstack(); # The line is as followed: # free_memory : XXXX my $info = target_cmd_output_root($ho, "$toolstack info", 10); @@ -1558,7 +1565,7 @@ sub guest_check_up ($) { sub guest_get_state ($$) { my ($ho,$gho) = @_; - my $domains= target_cmd_output_root($ho, toolstack($ho)->{Command}." list"); + my $domains= target_cmd_output_root($ho, common_toolstack()." list"); $domains =~ s/^Name.*\n//; foreach my $l (split /\n/, $domains) { $l =~ m/^(\S+) (?: \s+ \d+ ){3} \s+ ([-a-z]+) \s/x or die "$l ?"; @@ -1763,7 +1770,7 @@ sub guest_find_domid ($$) { my ($ho,$gho) = @_; return if defined $gho->{Domid}; my $list= target_cmd_output_root($ho, - toolstack($ho)->{Command}." list $gho->{Name}"); + common_toolstack()." list $gho->{Name}"); $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m or die "domain list: $list"; $1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";