diff options
| -rwxr-xr-x | bin/wifi_client_test_netplan.py | 35 | ||||
| -rw-r--r-- | units/mediacard/test-plan.pxu | 12 |
2 files changed, 34 insertions, 13 deletions
diff --git a/bin/wifi_client_test_netplan.py b/bin/wifi_client_test_netplan.py index 1f7e5f4c..c74320ed 100755 --- a/bin/wifi_client_test_netplan.py +++ b/bin/wifi_client_test_netplan.py @@ -23,6 +23,7 @@ import time import shutil from struct import pack from socket import inet_ntoa +import sys print = functools.partial(print, flush=True) @@ -188,10 +189,39 @@ def netplan_apply_config(): retcode = sp.call(cmd, shell=True, env=env) if retcode != 0: print("ERROR: failed netplan apply call") + print() return False + print() return True +def _get_networkctl_state(interface): + cmd = 'networkctl status --no-pager --no-legend {}'.format(interface) + output = sp.check_output(cmd, shell=True) + for line in output.decode(sys.stdout.encoding).splitlines(): + key, val = line.strip().split(':', maxsplit=1) + if key == "State": + return val + + +def wait_for_routable(interface, max_wait=15): + routable = False + attempts = 0 + while not routable and attempts < max_wait: + state = _get_networkctl_state(interface) + print(state) + if "routable" in state: + routable = True + break + time.sleep(1) + attempts += 1 + if routable: + print("Reached routable state") + else: + print("WARN: did not reach routable state") + print() + + def perform_ping_test(interface): cmd = 'gateway_ping_test -v --interface={}'.format(interface) print_cmd(cmd) @@ -204,6 +234,7 @@ def print_journal_entries(start): cmd = ('journalctl -q --no-pager ' '-u systemd-networkd.service ' '-u wpa_supplicant.service ' + ' -u netplan-* ' '--since "{}" '.format(start.strftime('%Y-%m-%d %H:%M:%S'))) print_cmd(cmd) sp.call(cmd, shell=True) @@ -258,9 +289,11 @@ def main(): netplan_config_restore() print_journal_entries(start_time) raise SystemExit(1) - print() time.sleep(20) + print_head("Wait for interface to be routable") + wait_for_routable(args.interface) + # Check connection by ping or link status print_head("Perform a ping test") test_result = perform_ping_test(args.interface) diff --git a/units/mediacard/test-plan.pxu b/units/mediacard/test-plan.pxu index 58d3f07b..2ef8a011 100644 --- a/units/mediacard/test-plan.pxu +++ b/units/mediacard/test-plan.pxu @@ -14,9 +14,6 @@ _name: Mediacard tests (Manual) _description: Mediacard tests (Manual) include: - mediacard/sd-insert certification-status=blocker - mediacard/sd-storage certification-status=blocker - mediacard/sd-remove certification-status=blocker mediacard/sdhc-insert certification-status=blocker mediacard/sdhc-storage certification-status=blocker mediacard/sdhc-remove certification-status=blocker @@ -34,9 +31,6 @@ unit: test plan _name: Mediacard tests (after suspend) _description: Mediacard tests (after suspend) include: - suspend/sd-insert-after-suspend certification-status=blocker - suspend/sd-storage-after-suspend certification-status=blocker - suspend/sd-remove-after-suspend certification-status=blocker suspend/sdhc-insert-after-suspend certification-status=blocker suspend/sdhc-storage-after-suspend certification-status=blocker suspend/sdhc-remove-after-suspend certification-status=blocker @@ -46,9 +40,6 @@ unit: test plan _name: Mediacard tests (certification blockers only) _description: Mediacard tests (certification blockers only) include: - mediacard/sd-insert certification-status=blocker - mediacard/sd-storage certification-status=blocker - mediacard/sd-remove certification-status=blocker mediacard/sdhc-insert certification-status=blocker mediacard/sdhc-storage certification-status=blocker mediacard/sdhc-remove certification-status=blocker @@ -58,9 +49,6 @@ unit: test plan _name: Mediacard tests (after suspend, certification blockers only) _description: Mediacard tests (after suspend, certification blockers only) include: - suspend/sd-insert-after-suspend certification-status=blocker - suspend/sd-storage-after-suspend certification-status=blocker - suspend/sd-remove-after-suspend certification-status=blocker suspend/sdhc-insert-after-suspend certification-status=blocker suspend/sdhc-storage-after-suspend certification-status=blocker suspend/sdhc-remove-after-suspend certification-status=blocker |
