From 796a11507c979ea6343717ce0a7fc3cdfe0332ea Mon Sep 17 00:00:00 2001 From: Gareth Sylvester-Bradley <31761158+garethsb@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:15:19 +0100 Subject: [PATCH 1/3] Add MOCK_SERVICES_WARM_UP_DELAY --- nmostesting/Config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nmostesting/Config.py b/nmostesting/Config.py index 9c6dbe8f..c663ec91 100644 --- a/nmostesting/Config.py +++ b/nmostesting/Config.py @@ -19,6 +19,9 @@ # Please consult the documentation for instructions on how to adjust these values for common testing setups including # unicast DNS-SD and HTTPS testing. +# Number of seconds to wait after starting the mock DNS server, authorization server, etc. before running tests. +# This gives the API or client under test a chance to use these services before any test case is run. +MOCK_SERVICES_WARM_UP_DELAY = 0 # Enable or disable DNS-SD advertisements. Browsing is always permitted. # The IS-04 Node tests create a mock registry on the network unless the `ENABLE_DNS_SD` parameter is set to `False`. From 43a1f764284eb4da960e9f5d75463ae91ead52d9 Mon Sep 17 00:00:00 2001 From: Gareth Sylvester-Bradley <31761158+garethsb@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:22:42 +0100 Subject: [PATCH 2/3] Delay running tests until after MOCK_SERVICES_WARM_UP_DELAY Co-authored-by: Simon Lo --- nmostesting/NMOSTesting.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nmostesting/NMOSTesting.py b/nmostesting/NMOSTesting.py index a4d320f9..e5f2176b 100644 --- a/nmostesting/NMOSTesting.py +++ b/nmostesting/NMOSTesting.py @@ -1139,6 +1139,13 @@ def main(args): print(" * Testing tool running on 'http://{}:{}'. Version '{}'" .format(get_default_ip(), core_app.config['PORT'], TOOL_VERSION)) + # Give an API or client that is already running a chance to use the mock services + # before running any test cases + if CONFIG.MOCK_SERVICES_WARM_UP_DELAY: + print(" * Warm up your engines, testing begins in {} seconds..." + .format(CONFIG.MOCK_SERVICES_WARM_UP_DELAY)) + time.sleep(CONFIG.MOCK_SERVICES_WARM_UP_DELAY) + exit_code = 0 if "suite" not in vars(CMD_ARGS): # Interactive testing mode. Await user input. From 215f736469e5260b7629592e5adf8769c50555ca Mon Sep 17 00:00:00 2001 From: Gareth Sylvester-Bradley <31761158+garethsb@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:43:06 +0100 Subject: [PATCH 3/3] Tweak message Co-authored-by: jonathan-r-thorpe <64410119+jonathan-r-thorpe@users.noreply.github.com> --- nmostesting/NMOSTesting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmostesting/NMOSTesting.py b/nmostesting/NMOSTesting.py index e5f2176b..e4860827 100644 --- a/nmostesting/NMOSTesting.py +++ b/nmostesting/NMOSTesting.py @@ -1142,7 +1142,7 @@ def main(args): # Give an API or client that is already running a chance to use the mock services # before running any test cases if CONFIG.MOCK_SERVICES_WARM_UP_DELAY: - print(" * Warm up your engines, testing begins in {} seconds..." + print(" * Waiting for {} seconds to allow discovery of mock services" .format(CONFIG.MOCK_SERVICES_WARM_UP_DELAY)) time.sleep(CONFIG.MOCK_SERVICES_WARM_UP_DELAY)