From 2831c54b78a121683f78759ade08420f1f82616c Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Tue, 14 Aug 2018 10:42:23 -0500 Subject: [PATCH] add the first test for test.ping connecting the minion to master --- .kitchen.yml | 4 ++++ tests/conftest.py | 10 ---------- tests/integration/test_connection.py | 7 +++++++ 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 tests/integration/test_connection.py diff --git a/.kitchen.yml b/.kitchen.yml index 1b9d438..0c92e05 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -101,3 +101,7 @@ suites: excludes: - centos-6 +verifier: + name: shell + remote_exec: false + command: pytest -v tests/integration/ diff --git a/tests/conftest.py b/tests/conftest.py index 08d2c88..3fc60e5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,13 +17,3 @@ else: @pytest.fixture def host(): return test_host - - -@pytest.fixture -def salt(): - if 'windows' in os.environ.get('KITCHEN_INSTANCE'): - tmpconf = r'c:\Users\vagrant\AppData\Local\Temp\kitchen\etc\salt' - else: - test_host.run('sudo chown -R {0} /tmp/kitchen'.format(os.environ.get('KITCHEN_USERNAME'))) - tmpconf = '/tmp/kitchen/etc/salt' - return functools.partial(test_host.salt, config=tmpconf) diff --git a/tests/integration/test_connection.py b/tests/integration/test_connection.py new file mode 100644 index 0000000..bcf986a --- /dev/null +++ b/tests/integration/test_connection.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +import pytest + + +def test_ping(host): + with host.sudo(): + assert host.salt('test.ping')