diff --git a/test/test.py b/test/test.py index ead0c8c..1f04dba 100644 --- a/test/test.py +++ b/test/test.py @@ -147,6 +147,11 @@ def setUpClass(cls): cls.after = int(time.time()) cls.config_testapp_url() cls.before = int(time.time()) + else: + span = os.getenv('URL_SCAN_SPAN') + if span: + cls.after = int(time.time() - int(span)) + cls.before = int(time.time()) @classmethod def config_testapp_url(cls): @@ -165,7 +170,9 @@ def config_testapp_url(cls): CliEAATest.cli_print(f"Now waiting {delay}s to get the log collected") time.sleep(delay) else: - CliEAATest.cli_print("WARNING: no environment variable URL_TEST_TRAFFIC defined, we assume the traffic is generated separately") + CliEAATest.cli_print("WARNING: no environment variable URL_TEST_TRAFFIC defined, we assume " + "the traffic is generated separately. You may use URL_SCAN_SPAN to " + "configure how far back we need to scan in the past.") def test_useraccess_log_raw(self): """ @@ -327,7 +334,6 @@ def test_list_directories(self): self.assertEqual(cmd.returncode, 0, 'return code must be 0') - class TestCliEAA(CliEAATest): """ General commands of the CLI like version or help