From 1623db4b24d4cbf3b276cfb1a40cf04763f801e2 Mon Sep 17 00:00:00 2001 From: Julia Date: Thu, 4 Apr 2024 10:13:13 +0200 Subject: [PATCH] feat: add fixture to modify macos timezone --- .../test_vulnerability_detector/conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/end_to_end/test_vulnerability_detector/conftest.py b/tests/end_to_end/test_vulnerability_detector/conftest.py index 646ae67040..f7f7adff14 100644 --- a/tests/end_to_end/test_vulnerability_detector/conftest.py +++ b/tests/end_to_end/test_vulnerability_detector/conftest.py @@ -399,3 +399,14 @@ def pytest_html_results_summary(prefix, summary, postfix): def pytest_configure(config): if not config.option.css: config.option.css = [STYLE_PATH] + + +@pytest.fixture(scope="session", autouse=True) +def modify_timezone(request): + inventory_path = request.config.getoption('--inventory-path') + host_manager = HostManager(inventory_path) + hosts = host_manager.get_group_hosts('agent') + + for host in hosts: + if host_manager.get_host_variables(host)['os'] and 'macos' in host_manager.get_host_variables(host)['os']: + host_manager.run_command(host, 'systemsetup -settimezone GMT')