nixos/test-runner: Fix execute() flakiness

Instead of using the magic string, we now just base64-encode everything
and check for a newline.
This commit is contained in:
Janne Heß
2021-10-24 15:46:45 +02:00
parent 5f917bc275
commit 1640359f33
5 changed files with 43 additions and 16 deletions

View File

@@ -95,7 +95,7 @@ in makeTest {
"mkswap /dev/vda1 -L swap",
# Install onto /mnt
"nix-store --load-db < ${pkgs.closureInfo {rootPaths = [installedSystem];}}/registration",
"nixos-install --root /mnt --system ${installedSystem} --no-root-passwd",
"nixos-install --root /mnt --system ${installedSystem} --no-root-passwd --no-channel-copy >&2",
)
machine.shutdown()
@@ -110,7 +110,7 @@ in makeTest {
)
# Hibernate machine
hibernate.succeed("systemctl hibernate &")
hibernate.execute("systemctl hibernate &", check_return=False)
hibernate.wait_for_shutdown()
# Restore machine from hibernation, validate our ramfs file is there.