Merge fort-nix/nix-bitcoin#435: run-tests: fix vm cmd

98bc0917d7 run-tests: fix `vm` cmd (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 98bc0917d7

Tree-SHA512: c08810fbddac6493c1c8655abebca557a3d096b570598c0d97dfda5a31c864f1b7abc531536f197e1a7a093be5b39b3d9de4b64f8d019814e706080a5c435726
This commit is contained in:
Jonas Nick 2022-01-04 21:59:04 +00:00
commit 5a24f2afb2
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -185,13 +185,11 @@ vm() {
nix-build --out-link $TMPDIR/vm -E "((import \"$scriptDir/tests.nix\" {}).getTest \"$scenario\").vmWithoutTests" nix-build --out-link $TMPDIR/vm -E "((import \"$scriptDir/tests.nix\" {}).getTest \"$scenario\").vmWithoutTests"
echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB" echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB"
extraNetOpts= [[ $NB_TEST_ENABLE_NETWORK ]] || export QEMU_NET_OPTS="restrict=on,$QEMU_NET_OPTS"
[[ $NB_TEST_ENABLE_NETWORK ]] || extraNetOpts='restrict=on'
USE_TMPDIR=1 \ USE_TMPDIR=1 \
NIX_DISK_IMAGE=$TMPDIR/img.qcow2 \ NIX_DISK_IMAGE=$TMPDIR/img.qcow2 \
QEMU_OPTS="-smp $numCPUs -m $memoryMiB -nographic $QEMU_OPTS" \ QEMU_OPTS="-smp $numCPUs -m $memoryMiB -nographic $QEMU_OPTS" \
QEMU_NET_OPTS="$extraNetOpts $QEMU_NET_OPTS" \
$TMPDIR/vm/bin/run-*-vm $TMPDIR/vm/bin/run-*-vm
} }