run-tests cd into each test directory before running it

This commit is contained in:
Daniel Barlow
2022-09-23 17:21:43 +01:00
parent 1bc8fd7873
commit 7a4314baee
4 changed files with 14 additions and 12 deletions

View File

@@ -1,14 +1,14 @@
set -e
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/$DEVICE.nix" -o smoke.img
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '<liminix>' -I liminix-config=./configuration.nix --arg device "import <liminix/devices/$DEVICE.nix>" -A outputs.squashfs -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
unsquashfs -q -d $dest_path -excludes smoke.img /dev
cd $dest_path;
db=*-s6-rc-db/compiled/
db=nix/store/*-s6-rc-db/compiled/
test -d $db
chmod -R +w $db
# check we have closure of config.services (lo.link.service exists only