Verified Commit 8197146c authored by Karel Koci's avatar Karel Koci 🤘
Browse files

tests: use for wait scripts invocation

The previous commit added shell property exactly for this. This now
tweaks code to use it.
parent 335126c4
......@@ -131,7 +131,7 @@ def fixture_client_board(board, board_serial, board_root_password, lan1_client):
# Now spawn client container and connect
pexp = lan1_client.pexpect(['ssh', '-q', ''])
pexp.expect_exact("root@'s password:")
......@@ -151,7 +151,7 @@ def fixture_isp_container(lxd, device_map):
"""Minimal ISP container used to provide the Internet access for the most of the tests.
with nsfarm.lxd.Container(lxd, 'isp-common', device_map) as container:
yield container
......@@ -160,7 +160,7 @@ def fixture_lan1_client(lxd, device_map):
"""Starts client container on LAN1 and provides it.
with nsfarm.lxd.Container(lxd, 'client', {"net:lan": device_map["net:lan1"]}) as container:
yield container
......@@ -29,7 +29,7 @@ class TestStatic(common.InternetTests):"uci set network.wan.gateway=''")"uci set network.wan.dns=''")"uci commit network")
nsfarm.cli.Shell(container.pexpect()).run('wait4network')'wait4network')"/etc/init.d/network restart")"while ! ping -c1 -w1 >/dev/null; do true; done")
yield client_board
......@@ -53,7 +53,7 @@ class TestDHCP(common.InternetTests):
with nsfarm.lxd.Container(lxd, 'isp-dhcp', device_map) as container:"uci set network.wan.proto='dhcp'")"uci commit network")
nsfarm.cli.Shell(container.pexpect()).run('wait4network')'wait4network')"/etc/init.d/network restart")"while ! ip route | grep -q default; do sleep 1; done")
yield client_board
......@@ -25,7 +25,7 @@ def fixture_attacker_container(lxd, device_map):
intentional as this way we won't poison data that much even if we send them to Sentinel network.
with Container(lxd, 'attacker', device_map) as container:
yield container
......@@ -121,7 +121,7 @@ class TestNoInternetAccess:
"""This provides DHCP server on WAN interface the router could use to autoconfigure WAN if it would want to.
with Container(lxd, "isp-dhcp", device_map) as container:
Shell(container.pexpect()).run("wait4network")"wait4network")"/etc/init.d/network restart") # Trigger network restart to force potential renew now
# Unfortunatelly we can't wait for router to pickup address as technically it should not. Instead we wait
# some amount of time we can expect it would picked up address from DHCP.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment