Skip to content
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

fix: Add test for rpm-ostree rebase #161

Merged
merged 4 commits into from
Apr 15, 2024
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
3 changes: 2 additions & 1 deletion integration-tests/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ rebase:

upgrade:
FROM +test-base
RUN mkdir -p /etc/bluebuild && touch /etc/bluebuild/cli_test.tar.gz

RUN mkdir -p /etc/bluebuild && touch $BB_TEST_LOCAL_IMAGE
RUN bluebuild -vv upgrade recipes/recipe.yml

secureblue-base:
Expand All @@ -88,6 +88,7 @@ legacy-base:

test-base:
FROM ../+blue-build-cli-alpine
ENV BB_TEST_LOCAL_IMAGE=/etc/bluebuild/cli_test.tar.gz
ENV CLICOLOR_FORCE=1

COPY ./mock-scripts/ /usr/bin/
Expand Down
16 changes: 16 additions & 0 deletions integration-tests/mock-scripts/rpm-ostree
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#!/bin/sh

set -euo pipefail

echo 'Running rpm-ostree'

if [ "$1" = "rebase" ]; then
if [ "$2" = "ostree-unverified-image:oci-archive:$BB_TEST_LOCAL_IMAGE" ]; then
echo "Rebased to local image $BB_TEST_LOCAL_IMAGE"
else
echo "Failed to rebase"
exit 1
fi
elif [ "$1" = "upgrade" ]; then
echo "Performing upgrade for $BB_TEST_LOCAL_IMAGE"
else
echo "Arg $1 is not recognized"
exit 1
fi