mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updated ufw tests to check for Salt
This commit is contained in:
parent
11d5c5c168
commit
831f982f6f
1 changed files with 12 additions and 13 deletions
|
@ -1,4 +1,3 @@
|
|||
import logging
|
||||
import os.path
|
||||
import pathlib
|
||||
import subprocess
|
||||
|
@ -6,8 +5,6 @@ import subprocess
|
|||
import pytest
|
||||
from pytestskipmarkers.utils import platform
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows()
|
||||
def test_salt_ufw(salt_master, salt_call_cli, install_salt):
|
||||
|
@ -25,21 +22,23 @@ def test_salt_ufw(salt_master, salt_call_cli, install_salt):
|
|||
assert ufw_master_path.exists()
|
||||
assert ufw_master_path.is_file()
|
||||
|
||||
ls_cmd = "ls -alhrt /etc/ufw/applications.d/"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ls_cmd)
|
||||
log.warning(f"DGM test_salt_ufw ls cmd ret '{ret}'")
|
||||
|
||||
cat_cmd = "cat /etc/ufw/applications.d/salt-master"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", cat_cmd)
|
||||
log.warning(f"DGM test_salt_ufw cat cmd ret '{ret}'")
|
||||
|
||||
ufw_list_cmd = "/usr/sbin/ufw app list"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ufw_list_cmd)
|
||||
log.warning(f"DGM test_salt_ufw list ret '{ret}'")
|
||||
assert "Available applications" in ret.stdout
|
||||
assert "Salt" in ret.stdout
|
||||
|
||||
ufw_upd_cmd = "/usr/sbin/ufw app update Salt"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ufw_upd_cmd)
|
||||
log.warning(f"DGM test_salt_ufw update ret '{ret}'")
|
||||
assert ret.returncode == 0
|
||||
|
||||
expected_info = """Profile: Salt
|
||||
Title: salt
|
||||
Description: fast and powerful configuration management and remote
|
||||
execution
|
||||
|
||||
Ports:
|
||||
4505,4506/tcp"""
|
||||
|
||||
ufw_info_cmd = "/usr/sbin/ufw app info Salt"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ufw_info_cmd)
|
||||
assert ret.data == expected_info
|
||||
|
|
Loading…
Add table
Reference in a new issue