From b07c77f4a465cc58b24bce57ae3b7dc8d4df7874 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 29 Mar 2020 18:50:34 +0200 Subject: [PATCH 1/2] secrets.nix: remove obsolete comment --- modules/secrets/secrets.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/secrets/secrets.nix b/modules/secrets/secrets.nix index 0149289..c79ca52 100644 --- a/modules/secrets/secrets.nix +++ b/modules/secrets/secrets.nix @@ -47,7 +47,6 @@ in }; # Operation of this service: - # - Create missing secrets that are composed of attrs from secrets.nix # - Set owner and permissions for all used secrets # - Make all other secrets accessible to root only # For all steps make sure that no secrets are copied to the nix store. From e398674964fb3c8bcfc00b2b051a7e2a692ade0d Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 29 Mar 2020 18:50:35 +0200 Subject: [PATCH 2/2] run-tests.sh: fix leaking tmp files outside TMPDIR - Move vm image (NIX_DISK_IMAGE) from $TMP to $TMPDIR - Set $PWD Also: - Simplify mktemp command - USE_TMPDIR=1: Don't create extra dir inside $TMPDIR --- test/run-tests.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/run-tests.sh b/test/run-tests.sh index dfd937e..5d59d35 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -29,7 +29,7 @@ export NIX_PATH=nixpkgs=$(nix eval --raw -f "$scriptDir/../pkgs/nixpkgs-pinned.n # Run the test. No temporary files are left on the host system. run() { # TMPDIR is also used by the test driver for VM tmp files - export TMPDIR=$(mktemp -d -p /tmp nix-bitcoin-test.XXXXXX) + export TMPDIR=$(mktemp -d /tmp/nix-bitcoin-test.XXX) trap "rm -rf $TMPDIR" EXIT nix-build --out-link $TMPDIR/driver "$scriptDir/test.nix" -A driver @@ -58,9 +58,12 @@ run() { echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB" [[ $NB_TEST_ENABLE_NETWORK ]] || QEMU_NET_OPTS='restrict=on' + cd $TMPDIR # The VM creates a VDE control socket in $PWD env -i \ NIX_PATH="$NIX_PATH" \ TMPDIR="$TMPDIR" \ + USE_TMPDIR=1 \ + NIX_DISK_IMAGE=$TMPDIR/img.qcow2 \ tests="$tests" \ QEMU_OPTS="-smp $numCPUs -m $memoryMiB -nographic $QEMU_OPTS" \ QEMU_NET_OPTS="$QEMU_NET_OPTS" \