xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 09/11] PDU/lab: Similar to xenuse
Date: Wed, 7 Jun 2017 18:49:00 +0100	[thread overview]
Message-ID: <1496857742-20191-10-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1496857742-20191-1-git-send-email-ian.jackson@eu.citrix.com>

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

But a bit different. Here is the syntax:

usage:  lab [-v] arguments
arguments are: {on|off|reboot|info|clear|pxe} tstXXX
           or: pxe     tstXXX [baudrate]
           or: connect tstXXX [baudrate]
           or: speed   tstXXX baudrate
           or: setpxe  tstXXX pxeYYY
           or: setmac  tstXXX xx:xx:xx:xx:xx:xx
  where tstXXX is a system name;  e.g. tst180
        pxeYYY is a pxeboot directory in pxeboot:/shares/tftpboot/lab/; e.g. pxe-bug6512
        xx:xx:xx:xx:xx:xx is a mac address; e.g. 00:e0:81:75:e3:fe
        baudrate is one of [300, 600, 1200, 2400, 4800, 9600, 19200, 38400]
        -v for verbose

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v4: Change config setting names from XenUse* to OracleLab*

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/PDU/lab.pm | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 Osstest/PDU/lab.pm

diff --git a/Osstest/PDU/lab.pm b/Osstest/PDU/lab.pm
new file mode 100644
index 0000000..5d95fc9
--- /dev/null
+++ b/Osstest/PDU/lab.pm
@@ -0,0 +1,56 @@
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
+# 
+# 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 <http://www.gnu.org/licenses/>.
+
+
+package Osstest::PDU::lab;
+
+use strict;
+use warnings;
+
+use Osstest;
+use Osstest::TestSupport;
+use IO::File;
+
+BEGIN {
+    use Exporter ();
+    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+    $VERSION     = 1.00;
+    @ISA         = qw(Exporter);
+    @EXPORT      = qw();
+    %EXPORT_TAGS = ( );
+
+    @EXPORT_OK   = qw();
+}
+
+sub new {
+    my ($class, $ho) = @_;
+    return bless { Host => $ho }, $class;
+}
+
+sub pdu_power_state {
+    my ($mo, $on) = @_;
+    my $onoff= $on ? "on" : "off";
+    my $lab= $c{OracleLabPath} || "lab";
+    my $user= get_host_property($mo->{Host}, "OracleLabUser", $c{OracleLabUser} || undef);
+
+    (
+	logm("lab overriding \$USER to $user"),
+	local $ENV{USER} = $user
+    ) if $user;
+    system_checked($lab, "$onoff", "$mo->{Host}{Name}");
+}
+
+1;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-06-07 17:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 17:48 [OSSTEST PATCH v4 00/11] livepatch test support Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 01/11] TestSupport: target_cmd_root_status: New sub which returns return code Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 02/11] TestSupport: target_cmd_*: Add some doc comments Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 03/11] TestSupport: target_cmd_output_root_status: New sub Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 04/11] mfi-common: Add an enable_livepatch runvar to the Xen build jobs Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 05/11] ts-xen-build: Build livepatches test-cases Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 06/11] ts-livepatch: Initial test-cases Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 07/11] sg-run-job: Add the test-livepatch Ian Jackson
2017-06-07 17:48 ` [OSSTEST PATCH 08/11] make-flight: Add livepatch build/test target in the matrix Ian Jackson
2017-06-07 17:49 ` Ian Jackson [this message]
2017-06-07 17:49 ` [OSSTEST PATCH 10/11] cs-adjust-flight: Rework runvar-build-set new value handling Ian Jackson
2017-06-07 17:49 ` [OSSTEST PATCH 11/11] sg-check-tested: Provide --flight option Ian Jackson
2017-06-07 18:54 ` [OSSTEST PATCH v4 00/11] livepatch test support Ian Jackson
2017-06-08  0:50 ` Konrad Rzeszutek Wilk
2017-06-09 11:01   ` Ian Jackson
2017-06-11  0:19     ` Konrad Rzeszutek Wilk
2017-06-09 14:35   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496857742-20191-10-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).