/usr/share/autopkgtest/xenlvm/with-testbed 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 57 58 59 | #!/bin/bash
set -e
trap 'exit 127' 0
adt_readconfig_needlock=y
. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/justconfig
while test $# -gt $nonoptargs; do shift; done
if ! test -f "$adt_play/good"; then
echo >&2 'testbed not in good state'
exit 127
fi
${ADT_XENLVM_SHARE}/cleanup >/dev/null
modprobe dm-snapshot >/dev/null 2>&1 ||:
for fs in fs swap; do
swap=${fs#fs}; eval "
bdsize=\$(blockdev --getsize \$lvm_baselv_${swap}namepath)
dmsetup create \$adt_devmapper_${swap}cowdev <<END
0 \$bdsize snapshot \$lvm_baselv_${swap}namepath \$lvm_cowdata_${swap}namepath n \$adt_${fs}_cowchunk
END
mkdir -p \$lvm_${fs}link_dirpath
ln -s \$lvm_${swap}snapdev \$lvm_${fs}link_ptr
"
done
xm restore $adt_play/xen-save
xm mem-set $adt_xmname $adt_testbed_ram
udevsettle
unset ADT_LOCKED
set +e
case $# in
0) debian_chroot="<with-adtxenlvm_$adt_nominum>$debian_chroot" $SHELL -i ;;
*) "$@" ;;
esac
rc=$?
set -e
xm destroy $adt_xmname
sleep 1
# ... this helps races where xm destroy leaves network interfaces etc.
# still enabled
sleep=0
while true; do
if dmsetup remove $adt_devmapper_cowdev; then break; fi
if [ $sleep -gt 3 ]; then fail "dmsetup remove kept failing"; fi
sleep $sleep
sleep=$(( $sleep + 1 ))
done
trap '' 0
exit $rc
|