diff --git a/tests/integration_tests/bugs/test_lp1813396.py b/tests/integration_tests/bugs/test_lp1813396.py index d726e518b4c..99ac92b289c 100644 --- a/tests/integration_tests/bugs/test_lp1813396.py +++ b/tests/integration_tests/bugs/test_lp1813396.py @@ -33,9 +33,11 @@ def test_gpg_no_tty(client: IntegrationInstance): ] verify_ordered_items_in_text(to_verify, log) verify_clean_log(log) - processes_in_cgroup = int( - client.execute( - "systemd-cgls -u cloud-config.service 2>/dev/null | wc -l" - ).stdout + control_groups = client.execute( + "systemd-cgls -u cloud-config.service 2>/dev/null | wc -l" + ).stdout + processes_in_cgroup = len(control_groups.split("\n")) + assert processes_in_cgroup < 2, ( + "Cloud-init didn't clean up after itself, " + f"cloud-config has remaining daemons:\n{control_groups}" ) - assert processes_in_cgroup < 2