WIP packaging test for salt.ufw

This commit is contained in:
David Murphy 2023-09-20 13:33:33 -06:00 committed by Pedro Algarvio
parent 1941ebe28e
commit 51a4a3ba5b
2 changed files with 31 additions and 1 deletions

View file

@ -1,2 +1,2 @@
pkg/common/salt-master.service /lib/systemd/system
pkg/common/salt.ufw /etc/ufw/applications.d
pkg/common/salt.ufw /etc/ufw/applications.d/salt-master

View file

@ -0,0 +1,30 @@
import logging
import os.path
import pathlib
import subprocess
import pytest
from pytestskipmarkers.utils import platform
log = logging.getLogger(__name__)
@pytest.mark.skip_on_windows()
def test_salt_ufw(salt_master, install_salt):
"""
Test salt.ufw for Debian/Ubuntu salt-master
"""
log.warning(f"DGM test_salt_ufw install_salt '{install_salt}'")
if install_salt.distro_id not in ("debian", "ubuntu"):
pytest.skip("Only tests Debian / Ubuntu packages")
pkg = [x for x in install_salt.pkgs if "deb" in x]
if not pkg:
pytest.skip("Not testing deb packages")
pkg = pkg[0].split("/")[-1]
if "rc" not in pkg:
pytest.skip("Not testing an RC package")
ufw_master_path = Path("/etc/ufw/applications.d/salt-master")
assert ufw_master_path.is_file()