Skip to content

ci/test-container.sh: Make it easier to execute locally and run treefile-apply test earlier #5286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2025
Merged
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
40 changes: 26 additions & 14 deletions ci/test-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ fatal() {

versionid=$(. /usr/lib/os-release && echo $VERSION_ID)

# This allows running this test in a podman container locally by running
# `SELF_BOOTSTRAP=1 ci/test-container.sh`.
if [ -n "${SELF_BOOTSTRAP:-}" ]; then
rm -rf "$PWD/installtree"
make install DESTDIR="$PWD/installtree"
Copy link
Member

Choose a reason for hiding this comment

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

Non blocking but for the future let's use a subdirectory of target/ for this type of stuff because it's already in .gitignore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, agree. This is consistent with tests/vmcheck/install.sh, but we should update both.

make -C tests/kolainst install DESTDIR="$PWD/installtree"
exec podman run -ti --rm --security-opt=label=disable -v "$PWD":/var/srv -w /var/srv \
quay.io/fedora/fedora-coreos:testing-devel sh -c \
'rsync -rlv installtree/ / && /var/srv/ci/test-container.sh'
fi

# Test overrides
case $versionid in
41)
Expand Down Expand Up @@ -76,6 +87,21 @@ rpm-ostree override replace $koji_kernel_url
# test that the new initramfs was generated
test -f /usr/lib/modules/${kver}-${krev}.fc${versionid}.x86_64/initramfs.img

# test treefile-apply
# do it before cliwrap because we want real dnf
if rpm -q ltrace vim-enhanced; then
fatal "ltrace and/or vim-enhanced exist"
fi
vim_vr=$(rpm -q vim-minimal --qf '%{version}-%{release}')
cat > /tmp/treefile.yaml << EOF
packages:
- ltrace
# a split base/layered version-locked package
- vim-enhanced
EOF
rpm-ostree experimental compose treefile-apply /tmp/treefile.yaml
rpm -q ltrace vim-enhanced-"$vim_vr"

rpm-ostree cliwrap install-to-root /

# Test a critical path package
Expand Down Expand Up @@ -144,18 +170,4 @@ if ! grep -qe "error: No such file or directory" err.txt; then
fatal "did not find expected error when skipping CLI wraps."
fi

# test treefile-apply
if rpm -q ltrace vim-enhanced; then
fatal "ltrace and/or vim-enhanced exist"
fi
vim_vr=$(rpm -q vim-minimal --qf '%{version}-%{release}')
cat > /tmp/treefile.yaml << EOF
packages:
- ltrace
# a split base/layered version-locked package
- vim-enhanced
EOF
rpm-ostree experimental compose treefile-apply /tmp/treefile.yaml
rpm -q ltrace vim-enhanced-"$vim_vr"

echo ok