Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Add salt-ssh state apply test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Dinca committed Jun 13, 2018
1 parent 62cbd93 commit 0d59a2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions tests/sls/echo.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test:
cmd.run:
- name: 'echo "test1"'
15 changes: 9 additions & 6 deletions tests/ssh/test_ssh_cross_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ def master(request, salt_root, client):
container__config__salt_config__conf_type='master',
container__config__image=request.param,
container__config__salt_config__extra_configs={
"file_roots": {
"file_roots": {"base": ["/etc/salt/sls"]}
},
"thin_extra_mods": {
"thin_extra_mods": "msgpack"
},
"custom_tops": {
"extension_modules": "/salt-toaster/tests/sls/ssh/xmod",
"master_tops": {
"toptest": True
},
},
},
container__config__salt_config__sls=['tests/sls/echo.sls',],
container__config__salt_config__roster=[client]
)
request.addfinalizer(obj['container'].remove)
Expand All @@ -67,3 +65,8 @@ def _ids(it):

def test_ping(master, client):
assert master.salt_ssh(client, "test.ping") is True


def test_state_apply_log_file_created(master, client):
res = master.salt_ssh(client, "state.apply echo")
assert res['cmd_|-test_|-echo "test1"_|-run']['changes']['stdout'] == 'test1'

0 comments on commit 0d59a2f

Please sign in to comment.