Fix pkg tests on arch

This commit is contained in:
Daniel A. Wozniak 2024-07-13 16:11:30 -07:00 committed by Daniel Wozniak
parent 3b697d39a2
commit f1d50c0ce2

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"]