File: test_signal_handler.py

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (18 lines) | stat: -rw-r--r-- 513 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest

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

USER_DATA = """\
#cloud-config
runcmd:
 - pkill cloud-init
"""


@pytest.mark.user_data(USER_DATA)
def test_no_warnings(client: IntegrationInstance):
    """Test that the signal handler does not log errors when suppressed."""
    verify_clean_boot(client)
    log = client.read_from_file("/var/log/cloud-init.log")
    assert "Received signal 15 resulting in exit" in log