From 14e2c1e4fb972145bb2d8ed5f60a435fc3319276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 15 May 2022 09:52:39 +0200 Subject: [PATCH] nixos/upterm: fix race condition in test --- nixos/tests/uptermd.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/tests/uptermd.nix b/nixos/tests/uptermd.nix index b2ff9a1e0d9c..d504ef064191 100644 --- a/nixos/tests/uptermd.nix +++ b/nixos/tests/uptermd.nix @@ -30,11 +30,14 @@ in server.wait_for_unit("uptermd.service") server.wait_for_unit("network-online.target") + # wait for upterm port to be reachable + client1.wait_until_succeeds("nc -z -v server 1337") + # Add SSH hostkeys from the server to both clients # uptermd needs an '@cert-authority entry so we need to modify the known_hosts file - client1.execute("sleep 3; mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls") + client1.execute("mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls") client1.execute("echo @cert-authority $(cat ~/.ssh/known_hosts) > ~/.ssh/known_hosts") - client2.execute("sleep 3; mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls") + client2.execute("mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls") client2.execute("echo @cert-authority $(cat ~/.ssh/known_hosts) > ~/.ssh/known_hosts") client1.wait_for_unit("multi-user.target")