|
@@ -1,8 +1,7 @@
|
|
# -*- coding: utf-8 -*-
|
|
# -*- coding: utf-8 -*-
|
|
import json
|
|
import json
|
|
-import os
|
|
|
|
|
|
+import pathlib
|
|
import pytest
|
|
import pytest
|
|
-import sys
|
|
|
|
|
|
|
|
|
|
|
|
def test_local_bad_opts(pepper_cli):
|
|
def test_local_bad_opts(pepper_cli):
|
|
@@ -17,7 +16,7 @@ def test_local_bad_opts(pepper_cli):
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail(
|
|
@pytest.mark.xfail(
|
|
- pytest.config.getoption("--salt-api-backend") == "rest_tornado",
|
|
|
|
|
|
+ 'config.getoption("--salt-api-backend") == "rest_tornado"',
|
|
reason="timeout kwarg isnt popped until next version of salt/tornado"
|
|
reason="timeout kwarg isnt popped until next version of salt/tornado"
|
|
)
|
|
)
|
|
def test_runner_client(pepper_cli):
|
|
def test_runner_client(pepper_cli):
|
|
@@ -30,34 +29,35 @@ def test_runner_client(pepper_cli):
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail(
|
|
@pytest.mark.xfail(
|
|
- pytest.config.getoption("--salt-api-backend") == "rest_tornado",
|
|
|
|
|
|
+ 'config.getoption("--salt-api-backend") == "rest_tornado"',
|
|
reason="wheelClient unimplemented for now on tornado",
|
|
reason="wheelClient unimplemented for now on tornado",
|
|
)
|
|
)
|
|
-def test_wheel_client_arg(pepper_cli, session_minion_id):
|
|
|
|
|
|
+def test_wheel_client_arg(pepper_cli, session_minion):
|
|
ret = pepper_cli('--client=wheel', 'minions.connected')
|
|
ret = pepper_cli('--client=wheel', 'minions.connected')
|
|
- assert ret == ['pytest-session-salt-minion-0']
|
|
|
|
|
|
+ assert ret == [session_minion.id]
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail(
|
|
@pytest.mark.xfail(
|
|
- pytest.config.getoption("--salt-api-backend") == "rest_tornado",
|
|
|
|
|
|
+ 'config.getoption("--salt-api-backend") == "rest_tornado"',
|
|
reason="wheelClient unimplemented for now on tornado",
|
|
reason="wheelClient unimplemented for now on tornado",
|
|
)
|
|
)
|
|
-def test_wheel_client_kwargs(pepper_cli, session_master_config_file):
|
|
|
|
|
|
+def test_wheel_client_kwargs(pepper_cli, session_master):
|
|
ret = pepper_cli(
|
|
ret = pepper_cli(
|
|
'--client=wheel', 'config.update_config', 'file_name=pepper',
|
|
'--client=wheel', 'config.update_config', 'file_name=pepper',
|
|
'yaml_contents={0}'.format(json.dumps({"timeout": 5})),
|
|
'yaml_contents={0}'.format(json.dumps({"timeout": 5})),
|
|
)
|
|
)
|
|
assert ret == 'Wrote pepper.conf'
|
|
assert ret == 'Wrote pepper.conf'
|
|
- assert os.path.isfile('{0}.d/pepper.conf'.format(session_master_config_file))
|
|
|
|
|
|
+
|
|
|
|
+ default_include_dir = pathlib.Path(session_master.config['default_include']).parent
|
|
|
|
+ pepper_config = (pathlib.Path(session_master.config_dir) / default_include_dir / 'pepper.conf')
|
|
|
|
+ assert pepper_config.exists
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail(
|
|
@pytest.mark.xfail(
|
|
- pytest.config.getoption("--salt-api-backend") == "rest_tornado",
|
|
|
|
|
|
+ 'config.getoption("--salt-api-backend") == "rest_tornado"',
|
|
reason="sshClient unimplemented for now on tornado",
|
|
reason="sshClient unimplemented for now on tornado",
|
|
)
|
|
)
|
|
-@pytest.mark.xfail(sys.version_info >= (3, 0),
|
|
|
|
- reason='Broken with python3 right now')
|
|
|
|
-def test_ssh_client(pepper_cli, session_roster_config, session_roster_config_file):
|
|
|
|
|
|
+def test_ssh_client(pepper_cli, session_ssh_roster_config):
|
|
ret = pepper_cli('--client=ssh', '*', 'test.ping')
|
|
ret = pepper_cli('--client=ssh', '*', 'test.ping')
|
|
assert ret['ssh']['localhost']['return'] is True
|
|
assert ret['ssh']['localhost']['return'] is True
|
|
|
|
|