From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH OSSTEST v3] PDU/xenuse: Support xenuse on machine not locked by current user
Date: Fri, 25 Oct 2013 11:29:42 +0100 [thread overview]
Message-ID: <1382696982-6316-1-git-send-email-ian.campbell@citrix.com> (raw)
xenuse checks that whoever is trying to reboot a machine "owns" that machine
via a locking mechanism. This is usually fine doesn't work well when one wants
to book a machine out of the osstest pool for adhoc testing. In this case
machine ownership is maintained by osstest ahd the machine remains locked to
osstest as far as xenuse is concerned.
Therefore add a global configuration option and perhost override to override
$USER (which xenuse obeys) to osstest.
---
v3: Simplified $ENV{USER} frobbing, more idiomatic Perl.
v2: Use "local $ENV{USER}" which contrary to my previous experiments does
actually work.
---
Osstest/PDU/xenuse.pm | 5 +++++
production-config | 1 +
2 files changed, 6 insertions(+)
diff --git a/Osstest/PDU/xenuse.pm b/Osstest/PDU/xenuse.pm
index 73a542d..6b0503f 100644
--- a/Osstest/PDU/xenuse.pm
+++ b/Osstest/PDU/xenuse.pm
@@ -44,7 +44,12 @@ sub pdu_power_state {
my ($mo, $on) = @_;
my $onoff= $on ? "on" : "off";
my $xenuse= $c{XenUsePath} || "xenuse";
+ my $user= get_host_property($mo->{Host}, "XenUseUser", $c{XenUseUser} || undef);
+ (
+ logm("XenUse overriding \$USER to $user"),
+ local $ENV{USER} = $user
+ ) if $user;
system_checked($xenuse, "--$onoff", "$mo->{Host}{Name}");
}
diff --git a/production-config b/production-config
index de9e55c..fb9d750 100644
--- a/production-config
+++ b/production-config
@@ -75,6 +75,7 @@ TftpPxeGroup osstest
TftpDiVersion 2013-09-23
XenUsePath /usr/groups/xencore/systems/bin/xenuse
+XenUseUser osstest
# We use the IP address because Citrix can't manage reliable nameservice
#DebianMirrorHost debian.uk.xensource.com
--
1.7.10.4
next reply other threads:[~2013-10-25 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-25 10:29 Ian Campbell [this message]
2013-10-28 15:47 ` [PATCH OSSTEST v3] PDU/xenuse: Support xenuse on machine not locked by current user Ian Jackson
2013-10-31 17:53 ` Ian Campbell
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=1382696982-6316-1-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.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).