X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=xen%2Fuserv-target;h=f0a7ff707251adce695bf4a1e29870b537b80c53;hb=HEAD;hp=8ba9d1a50261cbea2aea0f6e090ea84f1b938405;hpb=2e5ee4da3e69e85dadcfe64ee64d314721825074;p=autopkgtest.git diff --git a/xen/userv-target b/xen/userv-target index 8ba9d1a..f0a7ff7 100755 --- a/xen/userv-target +++ b/xen/userv-target @@ -7,6 +7,22 @@ if test -f /etc/lsb-release; then . /etc/lsb-release; fi d="${USERV_U_distro:-$DISTRIB_CODENAME}" n="${USERV_U_nominum:-adt}" +for v in ssh_privkey ssh_keyident_args; do + eval " + if [ \"x\$USERV_U_$v\" != x ]; then + export adt_$v=\"\$USERV_U_$v\" + fi + " +done + +if [ "x$adt_ssh_privkey$adt_ssh_keyident_args" = x ]; then + export adt_ssh_keyident_args=' ' + # There's no point directing userv callers to use the one in + # /root/.ssh/id_dsa_adt* since that one is only readable by + # root. So if they don't specify one we just let them have + # whatever the default is. +fi + nd="${n}_${d}" case "$nd" in @@ -24,7 +40,17 @@ run () { } case "$1" in -with) run adt-xenlvm-with-testbed sh -c 'echo y && exec cat' ;; pon0) run adt-xenlvm-on-testbed -- --print0-command ;; +console) xm console "$nd" ;; +with) + ADT_LOCKED="$nddir.lock" with-lock-ex -w "$nddir.lock" sh -ec ' + while adt-xenlvm-with-testbed \ + --adt-distro="$1" --adt-nominum="$2" \ + sh -c "echo y && read again" && \ + echo n && read again; do + : + done + ' locked-fragment "$d" "$n" +;; *) fail 'unknown mode' esac