diff --git a/tests/test_cli.py b/tests/test_cli.py index 308dc46..90dbf18 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -110,24 +110,6 @@ def test_launch_stop(script_runner, script, virt, config, suite): assert not any('scullery' in domain for domain in domains) -@pytest.mark.parametrize('config', ['complete'], indirect=True) -@pytest.mark.parametrize('suite', [ - 'one_minion', - 'two_minions', - 'one_master', - 'one_minion_one_master', - 'two_minions_one_master' - ]) -def test_stop(script_runner, script, virt, config, suite): - cmd = (script, '--config', config, '--suite', suite, '--stop') - result = script_runner.run(*cmd) - assert result.success - domains = [] - for domain in virt.listDomainsID(): - domains.append(virt.lookupByID(domain).name()) - assert not any('scullery' in domain for domain in domains) - - @pytest.mark.parametrize('config', ['complete'], indirect=True) @pytest.mark.parametrize('suite,masters,minions', [ ('one_minion', None, 'scullery-minion0'), @@ -150,3 +132,35 @@ def test_envfile(script_runner, script, config, suite, masters, minions): script_runner.run(*cmd, '--stop') assert os.path.isfile(envfile) is False + +@pytest.mark.parametrize('config', ['complete'], indirect=True) +@pytest.mark.parametrize('suite', [ + 'one_minion', + 'two_minions', + 'one_master', + 'one_minion_one_master', + 'two_minions_one_master' + ]) +def test_stop(script_runner, script, virt, config, suite): + cmd = (script, '--config', config, '--suite', suite, '--stop') + result = script_runner.run(*cmd) + assert result.success + domains = [] + for domain in virt.listDomainsID(): + domains.append(virt.lookupByID(domain).name()) + assert not any('scullery' in domain for domain in domains) + + +@pytest.mark.parametrize('config', ['complete'], indirect=True) +@pytest.mark.parametrize('suite', [ + 'one_minion', + 'two_minions', + 'one_master', + 'one_minion_one_master', + 'two_minions_one_master' + ]) +def test_already_stopped(script_runner, script, virt, config, suite): + cmd = (script, '--config', config, '--suite', suite, '--stop', '--debug') + result = script_runner.run(*cmd) + assert result.success + assert result.stderr.endswith('DEBUG - main_interactive: Deployment is not running\n')