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

parker: wg-keys are now generated in running mode

parent a68f58f4
......@@ -98,7 +98,7 @@ class SmallUBootStrategy(Strategy):
# that the shell responses does not mean all services are ready -.-
time.sleep(10)
# wait for the wireguard keygen to finish
# wait for gluon-reconfigure to finish
start = time.time()
for _ in range(120):
stdout, _, _ = self.shell.run("ps")
......@@ -107,10 +107,10 @@ class SmallUBootStrategy(Strategy):
time.sleep(5)
else:
raise Exception("glon-reconfigure took too long!")
logger.info("Gluon-Reconfigure took {}s".format(time.time()-start))
print("Gluon-Reconfigure took {}s".format(time.time()-start))
# wait until the config mode web-interface is ready
for _ in range(10):
for _ in range(20):
try:
print("")
r = requests.get("http://192.168.1.1/", timeout=3)
......
......@@ -92,11 +92,6 @@ def test_good_config_no_contact(target, in_good_config):
def test_good_config_autoupdater_enabled(target, in_good_config):
assert_web("http://192.168.1.1/cgi-bin/config/admin/autoupdater", 'value="1" id="id.1.1.enabled" name="id.1.1.enabled" checked="checked"')
@pytest.mark.config_mode
def test_generated_wg_key(target, in_good_config, command):
stdout, _, code = command.run('cat /etc/parker/wg-privkey | wg pubkey')
assert code == 0, "Verification of WG private key failed: {}".format(''.join(stdout))
@pytest.mark.config_mode
def test_ssh_authorized_keys(target, in_good_config, command):
r = requests.get('http://192.168.1.1/cgi-bin/config/admin/remote')
......@@ -171,6 +166,12 @@ def test_good_running_private_wifi_psk(target, in_good_running, config, command)
stdout, _, _ = command.run("uci show wireless")
assert config["private_wifi_psk"] in " ".join(stdout), "Did not find any wifi-interface with PSK {}".format(config["private_wifi_psk"])
@pytest.mark.running_mode
def test_generated_wg_key(target, in_good_running, command):
stdout, _, code = command.run('cat /etc/parker/wg-privkey | wg pubkey')
assert code == 0, "Verification of WG private key failed: {}".format(''.join(stdout))
@pytest.mark.running_mode
@pytest.mark.flaky(reruns=20, reruns_delay=10)
def test_good_running_wan_dns(target, in_good_running, config, command):
......
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