Fix pkg tests on arch

This commit is contained in:
Daniel A. Wozniak 2024-07-13 16:11:30 -07:00
parent cd9753ff0f
commit f2b4410681
2 changed files with 12 additions and 1 deletions

View file

@ -4,6 +4,7 @@ tests for pkg state
import logging
import os
import subprocess
import time
import pytest
@ -38,6 +39,16 @@ def refresh_db(grains, modules):
pytest.fail("Package database locked after 60 seconds, bailing out")
@pytest.fixture(scope="module", autouse=True)
def refresh_keys(grains, modules):
if grains["os_family"] == "Arch":
# We should be running this periodically when building new test runner
# images, otherwise this could take several minuets to complete.
proc = subprocess.run(["pacman-key", "--refresh-keys"], check=False)
if proc.returncode != 0:
pytest.fail("pacman-key --refresh-keys command failed.")
@pytest.fixture
def PKG_TARGETS(grains):
_PKG_TARGETS = ["figlet", "sl"]

View file

@ -20,7 +20,7 @@ pytestmark = [
pytest.mark.skip_unless_on_linux,
pytest.mark.skipif(
not check_system_python_version(), reason="Needs system python >= 3.8"
)
),
]