# Path: cloudify_agent/tests/api/pm/shared.py
# def patch_get_source():
# def patch_no_managed_plugin():
# def _test_create(daemon_fixture):
# def _test_create_overwrite(daemon_fixture):
# def _test_start(daemon_fixture):
# def _test_start_delete_amqp_queue(daemon_fixture):
# def _test_start_with_error(daemon_fixture):
# def _test_start_short_timeout(daemon_fixture):
# def _test_status(daemon_fixture):
# def _test_stop(daemon_fixture):
# def _test_stop_short_timeout(daemon_fixture):
# def _test_restart(daemon_fixture):
# def _test_two_daemons(daemon_fixture):
# def _test_conf_env_variables(daemon_fixture):
#     def _get_env_var(var):
#     def _check_env_var(var, expected_value):
# def _test_extra_env(daemon_fixture):
# def _test_execution_env(daemon_fixture):
# def _test_delete_before_stop(daemon_fixture):
# def _test_delete_before_stop_with_force(daemon_fixture):
# def _test_logging(daemon_fixture):
#     def log_and_assert(_message, _deployment_id=None):


import os
import time
import pytest
from cloudify.exceptions import CommandExecutionException
from cloudify_agent.tests.api.pm import shared
        nssm_daemon.runner.run,
        'sc getdisplayname {0}'.format(daemon.name))


@pytest.mark.only_rabbit
@pytest.mark.only_nt
def test_status(nssm_daemon):
    daemon = nssm_daemon.create_daemon()
    daemon.create()
    daemon.configure()
    assert not daemon.status()
    daemon.start()
    # on windows, the daemon.start completes and returns fast enough
    # that the service state is still SERVICE_START_PENDING
    for retry in range(5):
        if daemon.status():
            break
        time.sleep(1)
    else:
        pytest.fail('Daemon failed to start')


@pytest.mark.only_rabbit
@pytest.mark.only_nt
def test_create(nssm_daemon):
    shared._test_create(nssm_daemon)


@pytest.mark.only_rabbit
@pytest.mark.only_nt

# Path: cloudify_agent/tests/api/pm/shared.py
# def patch_get_source():
# def patch_no_managed_plugin():
# def _test_create(daemon_fixture):
# def _test_create_overwrite(daemon_fixture):
# def _test_start(daemon_fixture):
# def _test_start_delete_amqp_queue(daemon_fixture):
# def _test_start_with_error(daemon_fixture):
# def _test_start_short_timeout(daemon_fixture):
# def _test_status(daemon_fixture):
# def _test_stop(daemon_fixture):
# def _test_stop_short_timeout(daemon_fixture):
# def _test_restart(daemon_fixture):
# def _test_two_daemons(daemon_fixture):
# def _test_conf_env_variables(daemon_fixture):
#     def _get_env_var(var):
#     def _check_env_var(var, expected_value):
# def _test_extra_env(daemon_fixture):
# def _test_execution_env(daemon_fixture):
# def _test_delete_before_stop(daemon_fixture):
# def _test_delete_before_stop_with_force(daemon_fixture):
# def _test_logging(daemon_fixture):
#     def log_and_assert(_message, _deployment_id=None):


# Path: cloudify_agent/tests/api/pm/test_nssm.py
import os
import time
import pytest
from cloudify.exceptions import CommandExecutionException
from cloudify_agent.tests.api.pm import shared

        nssm_daemon.runner.run,
        'sc getdisplayname {0}'.format(daemon.name))


@pytest.mark.only_rabbit
@pytest.mark.only_nt
def test_status(nssm_daemon):
    daemon = nssm_daemon.create_daemon()
    daemon.create()
    daemon.configure()
    assert not daemon.status()
    daemon.start()
    # on windows, the daemon.start completes and returns fast enough
    # that the service state is still SERVICE_START_PENDING
    for retry in range(5):
        if daemon.status():
            break
        time.sleep(1)
    else:
        pytest.fail('Daemon failed to start')


@pytest.mark.only_rabbit
@pytest.mark.only_nt
def test_create(nssm_daemon):
    shared._test_create(nssm_daemon)


@pytest.mark.only_rabbit
@pytest.mark.only_nt

def test_create_overwrite(nssm_daemon):