mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updated test per reviewer comments
This commit is contained in:
parent
8395346ab5
commit
b58ee63a15
1 changed files with 13 additions and 19 deletions
|
@ -6,7 +6,8 @@ import pytest
|
|||
from pytestskipmarkers.utils import platform
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows()
|
||||
@pytest.mark.skip_on_windows
|
||||
@pytest.mark.skip_if_binaries_missing("ufw")
|
||||
def test_salt_ufw(salt_master, salt_call_cli, install_salt):
|
||||
"""
|
||||
Test salt.ufw for Debian/Ubuntu salt-master
|
||||
|
@ -17,30 +18,23 @@ def test_salt_ufw(salt_master, salt_call_cli, install_salt):
|
|||
# check that the salt_master is running
|
||||
assert salt_master.is_running()
|
||||
|
||||
## ufw_master_path = pathlib.Path("/etc/ufw/applications.d/salt-master")
|
||||
ufw_master_path = pathlib.Path("/etc/ufw/applications.d/salt.ufw")
|
||||
assert ufw_master_path.exists()
|
||||
assert ufw_master_path.is_file()
|
||||
|
||||
ufw_cmd_path = pathlib.Path("/usr/sbin/ufw")
|
||||
if ufw_cmd_path.exists():
|
||||
ufw_list_cmd = "/usr/sbin/ufw app list"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ufw_list_cmd)
|
||||
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)
|
||||
assert ret.returncode == 0
|
||||
|
||||
expected_info = """Profile: Salt
|
||||
ufw_list_cmd = "/usr/sbin/ufw app list"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ufw_list_cmd)
|
||||
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)
|
||||
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 expected_info in ret.data
|
||||
ufw_info_cmd = "/usr/sbin/ufw app info Salt"
|
||||
ret = salt_call_cli.run("--local", "cmd.run", ufw_info_cmd)
|
||||
assert expected_info in ret.data
|
||||
|
|
Loading…
Add table
Reference in a new issue