Skip to content

Commit

Permalink
integration tests: Fix cgroup parsing (#4402)
Browse files Browse the repository at this point in the history
It's possible to still have cgroup output for cloud-config.service
even if there are no spawned processes. Instead, use systemd-cgls
to list the cgroup and ensure there are isn't more than 1 line of
output.
  • Loading branch information
TheRealFalcon authored Sep 1, 2023
1 parent 10ce8ad commit 60b50dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/integration_tests/bugs/test_lp1813396.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ def test_gpg_no_tty(client: IntegrationInstance):
"Imported key 'E4D304DF' from keyserver 'keyserver.ubuntu.com'",
]
verify_ordered_items_in_text(to_verify, log)
result = client.execute("systemctl status cloud-config.service")
assert "CGroup" not in result.stdout
processes_in_cgroup = int(
client.execute(
"systemd-cgls -u cloud-config.service 2>/dev/null | wc -l"
).stdout
)
assert processes_in_cgroup < 2

0 comments on commit 60b50dd

Please sign in to comment.