add rudimentary test harness, turn example-configuration into a test
This commit is contained in:
22
tests/smoke/run.sh
Executable file
22
tests/smoke/run.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
set -e
|
||||
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix -o smoke.img
|
||||
|
||||
TESTS=$(cat <<"EOF"
|
||||
|
||||
trap 'echo "command $(eval echo $BASH_COMMAND) failed with exit code $?"; exit $?' ERR
|
||||
dest_path=${TMPDIR}/smoke.img-$$
|
||||
echo $dest_path
|
||||
unsquashfs -q -d $dest_path smoke.img
|
||||
cd $dest_path;
|
||||
db=*-s6-rc-db/compiled/
|
||||
test -d $db
|
||||
chmod -R +w $db
|
||||
# check we have closure of config.services (lo.link.service exists only
|
||||
# as a dependency)
|
||||
test "$(s6-rc-db -c $db type lo.link.service)" = "oneshot"
|
||||
echo OK
|
||||
EOF
|
||||
)
|
||||
|
||||
|
||||
nix-shell -p s6-rc -p squashfsTools --run "$TESTS" || exit 1
|
||||
Reference in New Issue
Block a user