From c8e190a7f702075fe1837088fbd2b5f4f99e8c2c Mon Sep 17 00:00:00 2001 From: Albrecht Lohofener Date: Thu, 9 Jan 2025 15:51:18 +0100 Subject: [PATCH] Add OPENWRT_AFTER_BOOT_CMD test --- test/tests/openwrt_docker_test.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/tests/openwrt_docker_test.py b/test/tests/openwrt_docker_test.py index 8a576ec..3e10b24 100644 --- a/test/tests/openwrt_docker_test.py +++ b/test/tests/openwrt_docker_test.py @@ -488,4 +488,17 @@ def test_port_8022_ssh(docker_services): stderr=subprocess.STDOUT, universal_newlines=True) - assert ('OpenWrt' in process.stdout) == True \ No newline at end of file + assert ('OpenWrt' in process.stdout) == True + + +@pytest.mark.parametrize("parameter", + [('OPENWRT_AFTER_BOOT_CMD','a=$$((1+1));echo The result of 1+1 is $${a}')], indirect=True, + ids=['OPENWRT_AFTER_BOOT_CMD="a=$$((1+1));echo The result of 1+1 is $${a}"']) +def test_openwrt_after_boot_cmd(docker_services): + wait_for_specific_log(docker_services, 'Detected OpenWrt is booted') + + wait_for_specific_log(docker_services, 'Command "a=$((1+1));echo The result of 1+1 is ${a}" exit successfully') + + logs = get_logs() + assert ('The result of 1+1 is 2' in logs) == True +