[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 09/11] PDU/lab: Similar to xenuse



From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
v4: Change config setting names from XenUse* to OracleLab*

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.