nixos/upterm: fix race condition in test

This commit is contained in:
Jörg Thalheim 2022-05-15 09:52:39 +02:00
parent eefafb54ef
commit 14e2c1e4fb
No known key found for this signature in database

View File

@ -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")