switch to test.ping for ssh setup tests

This commit is contained in:
MKLeb 2022-12-12 14:06:49 -05:00 committed by Megan Wilhite
parent 41fd39ebf4
commit c6eb9749a5

View file

@ -156,24 +156,24 @@ def salt_ssh_cli(
def test_setup(salt_ssh_cli, ssh_container_name, ssh_sub_container_name, ssh_password):
"""
Test salt-ssh grains id work for localhost.
Test salt-ssh setup works
"""
# Provide the passwd from the CLI to allow the key deploy
possible_ids = (ssh_container_name, ssh_sub_container_name)
ret = salt_ssh_cli.run(
"--passwd", ssh_password, "--key-deploy", "grains.get", "id", minion_tgt="*"
"--passwd", ssh_password, "--key-deploy", "test.ping", minion_tgt="*"
)
assert ret.returncode == 0
for id in possible_ids:
assert id in ret.data
assert ret.data[id] == id
assert ret.data[id] is True
# Run it again without the key deploy
ret = salt_ssh_cli.run("grains.get", "id", minion_tgt="*")
ret = salt_ssh_cli.run("test.ping", minion_tgt="*")
assert ret.returncode == 0
for id in possible_ids:
assert id in ret.data
assert ret.data[id] == id
assert ret.data[id] is True
# Run a test.sleep and kill it
sleep_time = 15