Skip to content

Commit

Permalink
Add waits in remote maintenance tests
Browse files Browse the repository at this point in the history
We need for system, service and network interface to fully start up.
  • Loading branch information
knuton committed Mar 31, 2024
1 parent 72787f9 commit 45d2c85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testing/integration/remote-maintenance.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ pkgs.nixosTest {
testScript = ''
def is_zt_operational(node):
node.wait_for_unit('zerotierone.service')
# Wait a moment for the service to come up
node.succeed('sleep 1')
# Config folder created
node.succeed('ls /var/lib/zerotier-one/')
# Interface created with fixed name
node.wait_for_unit('sys-devices-virtual-net-ztmntnc.device')
node.succeed('ip link show ztmntnc')
# Firewall is configured for SSH on ZT interface
node.succeed('iptables -nvL | grep ztmntnc | grep "tcp dpt:22"')
Expand All @@ -49,7 +52,7 @@ pkgs.nixosTest {
# Auto-connected makes ZT operational on its own
autoConnected.start()
autoConnected.wait_for_unit('zerotierone.service')
defaultConnectionSetting.wait_for_unit('multi-user.target')
is_zt_operational(autoConnected)
'';
}

0 comments on commit 45d2c85

Please sign in to comment.