BASICTOOLS="sh bash setsid loadkeys setfont login sulogin gzip sleep echo mount umount cryptsetup date dmsetup modprobe sed cmp tee rm"
DEBUGTOOLS="df free ls stty cat ps ln ip route dmesg dhclient mkdir cp ping dhclient strace less grep id tty touch du sort hostname find"
+STATEDIR="${BUILD_DIR:-.}/test/$(basename $(dirname $(realpath $0)))"
+STATEFILE="$STATEDIR/.testdir"
+TESTLOG="$STATEDIR/test.log"
+
function find_qemu_bin() {
# SUSE and Red Hat call the binary qemu-kvm
# Debian and Gentoo call it kvm
}
import_testdir() {
- STATEFILE=".testdir"
[[ -e $STATEFILE ]] && . $STATEFILE
if [[ -z "$TESTDIR" ]] || [[ ! -d "$TESTDIR" ]]; then
TESTDIR=$(mktemp --tmpdir=/var/tmp -d -t systemd-test.XXXXXX)
[[ -d $usrlibdir ]] && libdirs+=" $usrlibdir" && break
done
+ mkdir -p "$STATEDIR"
+
import_testdir
import_initdir
echo "TEST CLEANUP: $TEST_DESCRIPTION"
test_cleanup
rm -fr "$TESTDIR"
- rm -f .testdir
+ rm -f "$STATEFILE"
exit $?;;
--all)
echo -n "TEST: $TEST_DESCRIPTION ";
ret=$?
test_cleanup
rm -fr "$TESTDIR"
- rm -f .testdir
+ rm -f "$STATEFILE"
exit $ret
- ) </dev/null >test.log 2>&1
+ ) </dev/null >"$TESTLOG" 2>&1
ret=$?
if [ $ret -eq 0 ]; then
- rm test.log
+ rm "$TESTLOG"
echo "[OK]"
else
echo "[FAILED]"
- echo "see $(pwd)/test.log"
+ echo "see $TESTLOG"
fi
exit $ret;;
*) break ;;