mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Test fixup
- Actually fix cluster key rotate test by useing getpass module. - Skip a test that won't pass because amazon linux 2 systemd is not fully working in a container.
This commit is contained in:
parent
98a0673eca
commit
65dff0ba98
2 changed files with 5 additions and 13 deletions
|
@ -6,6 +6,8 @@ import types
|
|||
|
||||
import pytest
|
||||
|
||||
from tests.pytests.functional.states.test_service import _check_systemctl
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.skip_on_windows,
|
||||
pytest.mark.destructive_test,
|
||||
|
@ -18,6 +20,7 @@ def formula():
|
|||
return types.SimpleNamespace(name="nginx-formula", tag="2.8.1")
|
||||
|
||||
|
||||
@pytest.mark.skipif(_check_systemctl(), reason="systemctl degraded")
|
||||
def test_formula(modules):
|
||||
ret = modules.state.sls("nginx")
|
||||
assert not ret.errors
|
||||
|
|
|
@ -2,30 +2,19 @@
|
|||
Cluster scinarios.
|
||||
"""
|
||||
|
||||
import os
|
||||
import getpass
|
||||
import pathlib
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
import salt.crypt
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def login():
|
||||
path = pathlib.Path("/proc/self/loginuid")
|
||||
if not path.exists():
|
||||
path.write_text(f"{os.getuid()}", encoding="utf-8")
|
||||
return os.getlogin()
|
||||
|
||||
|
||||
def test_cluster_key_rotation(
|
||||
cluster_master_1,
|
||||
cluster_master_2,
|
||||
cluster_master_3,
|
||||
cluster_minion_1,
|
||||
cluster_cache_path,
|
||||
login,
|
||||
):
|
||||
cli = cluster_master_2.salt_cli(timeout=120)
|
||||
ret = cli.run("test.ping", minion_tgt="cluster-minion-1")
|
||||
|
@ -55,7 +44,7 @@ def test_cluster_key_rotation(
|
|||
assert not dfpath.exists()
|
||||
salt.crypt.dropfile(
|
||||
cluster_master_1.config["cachedir"],
|
||||
user=login,
|
||||
user=getpass.getuser(),
|
||||
master_id=cluster_master_1.config["id"],
|
||||
)
|
||||
assert dfpath.exists()
|
||||
|
|
Loading…
Add table
Reference in a new issue