linux/debian/tests/selftests

63 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/bin/bash -eu
PATH=/usr/sbin:/sbin:/usr/bin:/bin
getconfig() {
debian/bin/getconfig.py "$@"
}
# Look up current ABI name and 'localversion' (featureset/flavour) suffixes
abiname=$(getconfig version abiname)
arch=$(dpkg --print-architecture)
localversion=()
for featureset in $(getconfig base $arch featuresets); do
if [ "$(getconfig base '' $featureset enabled || echo True)" = True ]; then
for flavour in $(getconfig base $arch $featureset flavours); do
if [ "$featureset" = none ]; then
localversion+=(-$flavour)
else
localversion+=(-$featureset-$flavour)
fi
done
fi
done
steps=${#localversion[*]}
case "${ADT_REBOOT_MARK:-}" in
"")
step=-1
;;
step*)
step=${ADT_REBOOT_MARK#step}
;;
esac
if [ "$step" -ge 0 ]; then
ver=$abiname${localversion[$step]}
if [ "$(uname -r)" != "$ver" ]; then
echo >&2 "Should be running: $ver"
echo >&2 "Actually running: $(uname -r)"
2015-08-12 22:43:24 +00:00
else
cp -lR . $ADTTMP/build
cd $ADTTMP/build
make headers_install
# Enable testing CLONE_USERNS by unprivileged users
sysctl kernel.unprivileged_userns_clone=1
make -C tools/testing/selftests run_tests
fi
fi
step=$((step + 1))
if [ "$step" -lt "$steps" ]; then
# Load the next kernel
ver=$abiname${localversion[$step]}
kexec -l /boot/vmlinuz-$ver --initrd /boot/initrd.img-$ver --reuse-cmdline
/tmp/autopkgtest-reboot step$step
fi
exit 0