mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added tests for ufw allow salt
This commit is contained in:
parent
bd17823792
commit
f0743ec9a8
3 changed files with 23 additions and 0 deletions
1
changelog/64572.fixed.md
Normal file
1
changelog/64572.fixed.md
Normal file
|
@ -0,0 +1 @@
|
|||
Added salt.ufw to salt-master install on Debian and Ubuntu
|
|
@ -1,4 +1,5 @@
|
|||
/etc/salt/master.d
|
||||
/etc/ufw/applications.d/salt-master
|
||||
/etc/salt/pki/master/minions
|
||||
/etc/salt/pki/master/minions_autosign
|
||||
/etc/salt/pki/master/minions_denied
|
||||
|
|
|
@ -5,6 +5,7 @@ Test autosigning minions based on grain values.
|
|||
import os
|
||||
import shutil
|
||||
import stat
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -120,3 +121,23 @@ def test_autosign_grains_fail(
|
|||
) # get minion to try to authenticate itself again
|
||||
assert salt_minion.id not in salt_key_cli.run("-l", "acc")
|
||||
assert salt_minion.id in salt_key_cli.run("-l", "un")
|
||||
|
||||
|
||||
@pytest.mark.skip_unless_on_linux
|
||||
@pytest.mark.slow_test
|
||||
def test_ufw_allow(salt_master, grains):
|
||||
if grains["os_family"] != "Debian":
|
||||
pytest.skip("Only runs on Debian family.")
|
||||
|
||||
expected_output = """Skipping adding existing rule
|
||||
Skipping adding existing rule (v6)
|
||||
"""
|
||||
|
||||
proc = subprocess.Popen(
|
||||
"ufw allow salt\n", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE
|
||||
)
|
||||
out, err = proc.communicate()
|
||||
out_strg = out.decode()
|
||||
err_strg = err.decode()
|
||||
assert out_strg == expected_output
|
||||
assert err_strg != "ERROR: Could not find a profile matching 'salt'"
|
||||
|
|
Loading…
Add table
Reference in a new issue