Commit bb205bfd authored by chrissi^'s avatar chrissi^
Browse files

parker: Add host_container tests

parent 5fc7a66f
......@@ -64,6 +64,16 @@ def test_help(target, in_uboot):
def test_transition_to_config_mode(in_good_config):
pass
@pytest.mark.config_mode
def test_good_config_dhcp(target, host_container):
for _ in range(5):
stdout, _, _ = host_container.run("ip -br a")
if "192.168.1." in " ".join(stdout):
break
time.sleep(10)
else:
assert False, "No IP via DHCP recieved in time"
@pytest.mark.config_mode
def test_good_config_default_coordinates(target, in_good_config, config):
assert_web("http://192.168.1.1/cgi-bin/config/wizard", config["location_lat"])
......@@ -264,3 +274,61 @@ def test_good_running_ping_v6_parker(target, in_good_running, config, command):
break
else:
assert False, "Ping failed!"
@pytest.mark.running_mode
def test_good_running_autoupdater(target, in_good_running, command):
stdout, _, rc = command.run(
"autoupdater -n"
)
assert rc == 0, "Autoupdater failed"
@pytest.mark.config_mode
@pytest.mark.flaky(reruns=5, reruns_delay=10)
def test_good_running_dhcp(target, host_container):
for _ in range(5):
stdout, _, _ = host_container.run("ip -br a")
if "10." in " ".join(stdout):
break
time.sleep(5)
else:
assert False, "No IP via DHCP recieved in time"
@pytest.mark.config_mode
@pytest.mark.flaky(reruns=5, reruns_delay=10)
def test_good_running_ra(target, host_container):
for _ in range(5):
stdout, _, _ = host_container.run("ip -br -6 a")
if "2001:bf7:381" in " ".join(stdout):
break
time.sleep(5)
else:
assert False, "No IPv6 via RA recieved in time"
@pytest.mark.config_mode
def test_good_running_ping_gandolf6(target, host_container):
for _ in range(1):
stdout, _, rc = host_container.run(
"ping -c 10 -6 gandolf.stratum0.org"
)
for l in stdout:
if "transmitted" in l:
match = re.search(r"(\d+) received", l, re.DOTALL)
if match and int(match[1]) > 5:
return
time.sleep(5)
assert False, "Ping gandolv via v6 failed!"
@pytest.mark.config_mode
def test_good_running_ping_gandolf4(target, host_container):
for _ in range(5):
stdout, _, rc = host_container.run(
"ping -c 10 -4 gandolf.stratum0.org"
)
for l in stdout:
if "transmitted" in l:
match = re.search(r"(\d+) received", l, re.DOTALL)
if match and int(match[1]) > 5:
return
time.sleep(5)
assert False, "Ping gandolv via v6 failed!"
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