They operate
- on a scratch BTRFS filesystem (`/testsuite`)
-- created in a loopback-mounted file (`/testsuite.img`),
+- created in a loopback-mounted file (`/testsuite-of-snapper.img`),
- using a scratch Snapper configuration (`testsuite`).
However bugs do happen so it is recommended that you
See `setup-and-run-all` for the scratch setup and `run-all` for the actual
test set.
+
+The tests conform to the Test Anything Protocol (sloppily).
+`prove setup-and-run-all` works.
exit 1
fi
+# This test has been quickly and dirtily converted to TAP,
+# the Test Anything Protocol, http://testanything.org/tap-specification.html
+COUNT=0
+SUCCESS=true
+
function run()
{
+ COUNT=$((COUNT + 1))
cmd=$1
- echo
- echo "*** running $cmd ***"
- echo
+ echo >&2
+ echo >&2 "*** running $cmd ***"
+ echo >&2
./$cmd
if [ $? != 0 ] ; then
- echo "failed"
- exit 1
+ echo "not ok $COUNT $cmd"
+ SUCCESS=false
+ # exit 1
+ else
+ echo "ok $COUNT $cmd"
fi
}
test -x xattrs2 && run xattrs2
test -x xattrs3 && run xattrs3
test -x xattrs4 && run xattrs4
+
+echo "1..$COUNT" # TAP test plan
+$SUCCESS
#!/bin/bash
-set -eu
-set -x
+set -e # exit on failure.
+# ^
+# This also ensures that a failed test does not run the teardown step
+# and we can inspect the artifacts.
+set -u # unset variables are an error
+set -x # echo what's being done
+
if [ "$(id -u)" != "0" ]; then
set +x
echo "These tests only work when run as root." >&2