run-tests: support tests with multiple VMs in run

This commit is contained in:
Erik Arvstedt 2022-07-29 15:37:29 +02:00 committed by nixbitcoin
parent 17507835fc
commit 952cd3773f
No known key found for this signature in database
GPG Key ID: B6044ECBA2DAE5D0

View File

@ -137,7 +137,7 @@ run() {
echo 'is_interactive = True' echo 'is_interactive = True'
echo 'exec(open(os.environ["testScript"]).read())' echo 'exec(open(os.environ["testScript"]).read())'
# Start VM # Start VM
echo 'start_all()' echo 'if "machine" in vars(): machine.start()'
# Start REPL. # Start REPL.
# Use `code.interact` for the REPL instead of the builtin test driver REPL # Use `code.interact` for the REPL instead of the builtin test driver REPL
# because it supports low featured terminals like Emacs' shell-mode. # because it supports low featured terminals like Emacs' shell-mode.
@ -155,7 +155,6 @@ run() {
NIX_PATH="$NIX_PATH" \ NIX_PATH="$NIX_PATH" \
TMPDIR="$TMPDIR" \ TMPDIR="$TMPDIR" \
USE_TMPDIR=1 \ USE_TMPDIR=1 \
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="$QEMU_NET_OPTS" \ QEMU_NET_OPTS="$QEMU_NET_OPTS" \
$TMPDIR/driver/bin/nixos-test-driver <(echo "$tests") $TMPDIR/driver/bin/nixos-test-driver <(echo "$tests")