blob: 1bd9cee42e90bc5f7d350be9515ce1d73007e4b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
"""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)
assert client.execute("systemctl is-active puppet").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
|