From 9dc0f2558761a5fe419608e044c9b62bac233f05 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 9 Mar 2025 21:37:13 +0000 Subject: [PATCH] min-copy-clocure test: ensure sshd up before starting this test goes wrong intermittently in CI, see if this makes it more reliable --- tests/min-copy-closure/test.nix | 1 + .../min-copy-closure/wait-until-ready.expect | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/min-copy-closure/test.nix b/tests/min-copy-closure/test.nix index 0e23611..880105d 100644 --- a/tests/min-copy-closure/test.nix +++ b/tests/min-copy-closure/test.nix @@ -25,6 +25,7 @@ pkgs.runCommand "check" mkdir vm ${img}/run.sh --lan user,hostfwd=tcp::2022-:22 --background ./vm expect ${./wait-until-ready.expect} + echo ready to go export SSH_COMMAND="ssh -o StrictHostKeyChecking=no -p 2022 -i ${./id}" $SSH_COMMAND root@localhost echo ready IN_NIX_BUILD=true min-copy-closure --quiet root@localhost ${rogue} diff --git a/tests/min-copy-closure/wait-until-ready.expect b/tests/min-copy-closure/wait-until-ready.expect index 11aed4f..387051e 100644 --- a/tests/min-copy-closure/wait-until-ready.expect +++ b/tests/min-copy-closure/wait-until-ready.expect @@ -1,13 +1,20 @@ set timeout 60 spawn socat unix-connect:vm/console - -send "\r\n" expect { - "# " { send "hostname\r\n" }; + "s6-linux-init" { } + timeout { exit 1 } } - +set timeout 30 expect { - "(none)" {} - "liminix" {} - timeout { exit(1) } -} \ No newline at end of file + "#" { send "PS1=\$(echo 'I1JFQURZIyA=' | base64 -d); stty -echo\n" } + timeout { exit 1 } +} +expect { + "#READY#" { send "s6-svwait -t 10000 -u /run/service/sshd; echo continue\n" } + timeout { exit 1 } +} +expect { + "#READY#" { } + timeout { exit 1 } +}