Skip to content

Commit aa712ff

Browse files
cgwaltersJohan-Liebert1
authored andcommitted
test: Don't assert on journal message in shadow-fixup test
The mechanism works correctly — stepping through the scenario in a VM confirms the stale gshadow entry is carried through the 3-way merge, bootc-sysusers-shadow-sync.service removes it (logging 'orphaned'), and sysusers creates the group cleanly. However the test asserted specifically on the 'orphaned' log string in the journal. That is fragile: the log is emitted via tracing_journald and if it is dropped for any reason (an unexplained one-off CI event caused the failure in run 26862712140) the test fails even though the service did its job correctly. The file-state checks that follow (exactly one testbootcgroup entry in each of /etc/group and /etc/gshadow) are the authoritative proof; they cannot produce a false negative. Keep the journal query for diagnostic context, just stop asserting on it. Assisted-by: OpenCode (Claude Sonnet 4.6) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 85ad2f9 commit aa712ff

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tmt/tests/booted/test-44-shadow-fixup.nu

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ def second_boot [] {
7474

7575
assert ($active_state == "active") $"bootc-sysusers-shadow-sync.service not active: ($active_state)"
7676

77-
# The service must have logged removing the stale gshadow entry.
78-
let journal = (^journalctl -u bootc-sysusers-shadow-sync.service -b 0 --no-pager)
79-
assert ($journal | str contains "orphaned") (
80-
$"bootc-sysusers-shadow-sync.service did not log removing orphaned entries;\njournal:\n($journal)"
81-
)
77+
# Print the service journal for diagnostic context; don't assert on it.
78+
# The log message is emitted via tracing_journald, which can be silently
79+
# dropped if the journal socket is not yet visible at process start (e.g.
80+
# volatile journals, early-boot races). The file-state checks below are
81+
# the authoritative proof that the service did its job.
82+
^journalctl -u bootc-sysusers-shadow-sync.service -b 0 --no-pager | print
8283

8384
# sysusers must have (re)created the group cleanly in /etc/group.
8485
let group_lines = (open /etc/group | lines | where { |l| $l | str starts-with "testbootcgroup:" })

0 commit comments

Comments
 (0)