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`. diff --git a/nmostesting/NMOSTesting.py b/nmostesting/NMOSTesting.py index a4d320f9..e4860827 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(" * Waiting for {} seconds to allow discovery of mock services" + .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.