Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/kolainst/destructive/finalization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ prepare_tmpdir

case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
# Need to disable gpg verification for test builds
sed -i -e 's,gpg-verify=true,gpg-verify=false,' /etc/ostree/remotes.d/*.conf
# Need to disable gpg verification for test builds.
# On container-native FCOS there may be no remotes.d conf files.
for conf in /etc/ostree/remotes.d/*.conf; do
if test -f "$conf"; then
sed -i -e 's,gpg-verify=true,gpg-verify=false,' "$conf"
fi
done
# xref https://github.com/coreos/coreos-assembler/pull/2814
systemctl mask --now zincati

Expand Down
9 changes: 7 additions & 2 deletions tests/kolainst/destructive/staged-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ prepare_tmpdir

case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
# Need to disable gpg verification for test builds
sed -i -e 's,gpg-verify=true,gpg-verify=false,' /etc/ostree/remotes.d/*.conf
# Need to disable gpg verification for test builds.
# On container-native FCOS there may be no remotes.d conf files.
for conf in /etc/ostree/remotes.d/*.conf; do
if test -f "$conf"; then
sed -i -e 's,gpg-verify=true,gpg-verify=false,' "$conf"
fi
done

# Test our generator
test -f /run/systemd/generator/local-fs.target.requires/ostree-remount.service
Expand Down
6 changes: 6 additions & 0 deletions tests/kolainst/nondestructive/itest-remotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ trap _tmpdir_cleanup EXIT

ostree remote list > remotes.txt
if ! test -s remotes.txt; then
# On container-native FCOS, there are no ostree remotes — that's expected.
# On traditional ostree systems, missing remotes is a real regression.
if [ "$(rpmostree_query_json '.deployments[0]."container-image-reference" // empty')" != "" ]; then
echo "No ostree remotes found; skipping test on container-native system"
exit 0
fi
assert_not_reached "no ostree remotes"
fi
Comment on lines 14 to 22

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Unconditionally skipping the test when remotes.txt is empty can lead to silent test coverage loss. If a regression on a traditional (non-container-native) system causes all remotes to be missing, the test will now silently pass (skip) instead of failing. We should restrict this graceful skip only to container-native systems by checking the deployment type using rpm-ostree status.

Suggested change
if ! test -s remotes.txt; then
assert_not_reached "no ostree remotes"
# Container-native FCOS may not have any ostree remotes configured
echo "No ostree remotes found; skipping test on container-native system"
exit 0
fi
if ! test -s remotes.txt; then
if [ "$(rpmostree_query_json '.deployments[0].type')" = "container" ]; then
# Container-native FCOS may not have any ostree remotes configured
echo "No ostree remotes found; skipping test on container-native system"
exit 0
else
assert_not_reached "no ostree remotes"
fi
fi

date
Loading