/usr/share/autopkgtest/xenlvm/userv-target is in autopkgtest-xenlvm 2.0.1ubuntu4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | #!/bin/bash
set -e
fail () { printf >&2 "%s: %s\n" "$0" "$*"; exit 127; }
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
*/*|.*|*.*|*_*_*) fail 'dangerous format in distro or nominum' ;;
adt*) ;;
*) fail 'userv adtxenlvm only supports nominums starting with adt' ;;
esac
nddir=/var/lib/autopkgtest/xenlvm/"$nd"
test -d "$nddir" || fail 'unknown distro or nominum'
run () {
base="$1"; shift
exec "$base" --adt-distro="$d" --adt-nominum="$n" "$@"
}
case "$1" in
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
|