3 fail () { printf >&2 "%s: %s\n" "$0" "$*"; exit 127; }
5 if test -f /etc/lsb-release; then . /etc/lsb-release; fi
7 d="${USERV_U_distro:-$DISTRIB_CODENAME}"
8 n="${USERV_U_nominum:-adt}"
10 for v in ssh_privkey ssh_keyident_args; do
12 if [ \"x\$USERV_U_$v\" != x ]; then
13 export adt_$v=\"\$USERV_U_$v\"
18 if [ "x$adt_ssh_privkey$adt_ssh_keyident_args" = x ]; then
19 export adt_ssh_keyident_args=' '
20 # There's no point directing userv callers to use the one in
21 # /root/.ssh/id_dsa_adt* since that one is only readable by
22 # root. So if they don't specify one we just let them have
23 # whatever the default is.
29 */*|.*|*.*|*_*_*) fail 'dangerous format in distro or nominum' ;;
31 *) fail 'userv adtxenlvm only supports nominums starting with adt' ;;
34 nddir=/var/lib/autopkgtest/xenlvm/"$nd"
35 test -d "$nddir" || fail 'unknown distro or nominum'
39 exec "$base" --adt-distro="$d" --adt-nominum="$n" "$@"
43 with) run adt-xenlvm-with-testbed sh -c 'echo y && exec cat' ;;
44 pon0) run adt-xenlvm-on-testbed -- --print0-command ;;
45 console) xm console "$nd" ;;
46 *) fail 'unknown mode'