From 1b066da0672ac7f467f9de8ed8fcc3beee86af0a Mon Sep 17 00:00:00 2001 From: Alexander Graul Date: Mon, 5 Feb 2024 16:47:53 +0100 Subject: [PATCH] Skip hwclock test when executed inside a container --- .github/workflows/integration-opensuse.yml | 1 + .github/workflows/unit-opensuse.yml | 1 + tests/integration/modules/test_timezone.py | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/integration-opensuse.yml b/.github/workflows/integration-opensuse.yml index b057394668..727247be34 100644 --- a/.github/workflows/integration-opensuse.yml +++ b/.github/workflows/integration-opensuse.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest container: image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container steps: - name: Checkout Salt uses: actions/checkout@v4 diff --git a/.github/workflows/unit-opensuse.yml b/.github/workflows/unit-opensuse.yml index 5b943e4f3e..0d32b29a52 100644 --- a/.github/workflows/unit-opensuse.yml +++ b/.github/workflows/unit-opensuse.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest container: image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container steps: - name: Checkout Salt uses: actions/checkout@v4 diff --git a/tests/integration/modules/test_timezone.py b/tests/integration/modules/test_timezone.py index 8d7180cbd1..c1dc8a7b73 100644 --- a/tests/integration/modules/test_timezone.py +++ b/tests/integration/modules/test_timezone.py @@ -4,6 +4,7 @@ Linux and Solaris are supported """ import pytest +import os from tests.support.case import ModuleCase @@ -15,6 +16,8 @@ HAS_TZLOCAL = False +INSIDE_CONTAINER = os.getenv("HOSTNAME", "") == "salt-test-container" +@pytest.mark.skipif(INSIDE_CONTAINER, reason="No hwclock in a container") class TimezoneLinuxModuleTest(ModuleCase): def setUp(self): """