From b60126775a2a06f227a5028c6d20832c89f03fb6 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 28 Mar 2024 21:27:35 +0000 Subject: [PATCH] improve liminix-rebuild test * make it executable * improve robustness * do't hardcode services.default (why did it do this?) --- tests/min-copy-closure/configuration.nix | 4 ---- tests/min-copy-closure/test-liminix-rebuild.sh | 5 +++-- tests/min-copy-closure/wait-until-ready.expect | 7 ++++++- 3 files changed, 9 insertions(+), 7 deletions(-) mode change 100644 => 100755 tests/min-copy-closure/test-liminix-rebuild.sh diff --git a/tests/min-copy-closure/configuration.nix b/tests/min-copy-closure/configuration.nix index 9dfe0d4..fe80bf2 100644 --- a/tests/min-copy-closure/configuration.nix +++ b/tests/min-copy-closure/configuration.nix @@ -32,9 +32,5 @@ in { }; rootfsType = "jffs2"; - services.default = lib.mkForce (target { - name = "default"; - contents = with config.services; [ loopback ntp defaultroute4 sshd dhcpv4 ]; - }); }; } diff --git a/tests/min-copy-closure/test-liminix-rebuild.sh b/tests/min-copy-closure/test-liminix-rebuild.sh old mode 100644 new mode 100755 index 787e375..ca41d92 --- a/tests/min-copy-closure/test-liminix-rebuild.sh +++ b/tests/min-copy-closure/test-liminix-rebuild.sh @@ -1,10 +1,11 @@ +#!/usr/bin/env nix-shell +#! nix-shell -v -i bash -p expect socat + # This is a test for liminix-rebuild. It's not a CI test because # liminix-rebuild calls nix-build so won't run inside a derivation, # meaning you have to remember to run it manually when changing # liminix-rebuild -# nix-shell -p expect socat --run "sh ./tests/min-copy-closure/test-liminix-rebuild.sh " - . tests/test-helpers.sh set -e diff --git a/tests/min-copy-closure/wait-until-ready.expect b/tests/min-copy-closure/wait-until-ready.expect index 3da5adb..11aed4f 100644 --- a/tests/min-copy-closure/wait-until-ready.expect +++ b/tests/min-copy-closure/wait-until-ready.expect @@ -5,4 +5,9 @@ send "\r\n" expect { "# " { send "hostname\r\n" }; } -expect "(none)" \ No newline at end of file + +expect { + "(none)" {} + "liminix" {} + timeout { exit(1) } +} \ No newline at end of file