Skip to content

Commit

Permalink
system tests: minor fix for RHEL8 incompatibility
Browse files Browse the repository at this point in the history
quadlet tests were using 'systemctl show -P', a shortcut
that doesn't exist on RHEL8. Translate to old-systemd
language.

And, minor tweaks to make future test diagnosing easier.

This is a frontport of containers#17311; bringing from release branch
to main. Except that was an emergency, so it was a one-line
fix. This is a better long-term fix, not as trivial to review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
  • Loading branch information
edsantiago committed Feb 1, 2023
1 parent 68bbdc2 commit f69efb6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/system/252-quadlet.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,20 @@ function service_setup() {
local activestate="inactive"
fi

echo "$_LOG_PROMPT systemctl $startargs start $service"
run systemctl $startargs start "$service"
assert $status -eq 0 "Error starting systemd unit $service: $output"
echo "$output"
assert $status -eq 0 "Error starting systemd unit $service"

echo "$_LOG_PROMPT systemctl status $service"
run systemctl status "$service"
assert $status -eq $statusexit "systemctl status $service: $output"
echo "$output"
assert $status -eq $statusexit "systemctl status $service"

run systemctl show -P ActiveState "$service"
assert $status -eq 0 "systemctl show $service: $output"
echo "$_LOG_PROMPT systemctl show --value --property=ActiveState $service"
run systemctl show --value --property=ActiveState "$service"
echo "$output"
assert $status -eq 0 "systemctl show $service"
is "$output" $activestate
}

Expand Down

0 comments on commit f69efb6

Please sign in to comment.