Skip to content

Commit

Permalink
Merge pull request #1054 from rvykydal/run-rpm-ostree-container-rhel9…
Browse files Browse the repository at this point in the history
…-also-on-fedora

Run rpm ostree container rhel9 also on fedora
  • Loading branch information
rvykydal authored Feb 7, 2024
2 parents d61d540 + 1503309 commit d4a32f4
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ostreecontainer --no-signature-verification --transport=registry --url=quay.io/centos-bootc/fedora-bootc:eln
1 change: 1 addition & 0 deletions fragments/platform/rhel9/payload/ostreecontainer.ks
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ostreecontainer --no-signature-verification --transport=registry --url=quay.io/centos-bootc/centos-bootc:stream9
27 changes: 0 additions & 27 deletions rpm-ostree-container-rhel9.ks.in

This file was deleted.

33 changes: 33 additions & 0 deletions rpm-ostree-container-silverblue.ks.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#test name: rpm-ostree-container-silverblue
# https://github.com/rhinstaller/anaconda/pull/4617

# Test that ostreecontainer ks command works on Silverblue.
# Tests only installation of the palyload.
# Does not test that the installation is bootable.

# Use the default settings.
%ksappend common/common_no_payload.ks

# Set up the RPM OSTree source.
ostreecontainer --no-signature-verification --transport=registry --stateroot=fedora-silverblue --remote=fedora-silverblue --url=quay.io/fedora/fedora-silverblue:rawhide

%post

if ! ostree remote list | grep -q "fedora-silverblue"; then
echo "Unexpected name fedora-silverblue in \"$(ostree remote list)\"" >> /root/RESULT
fi

# Check the url of the remote.
url="$(ostree remote show-url fedora-silverblue)"

if [ "${url}" != "quay.io/fedora/fedora-silverblue:rawhide" ]; then
echo "Unexpected URL: ${url}" >> /root/RESULT
fi

if [ ! -e /root/RESULT ]; then
echo SUCCESS > /root/RESULT
fi

# Write the result into logs.
cat /root/RESULT
%end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Red Hat, Inc.
# Copyright (C) 2023 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
Expand All @@ -19,10 +19,15 @@

# Ignore unused variable parsed out by tooling scripts as test tags metadata
# shellcheck disable=SC2034
TESTTYPE="payload ostree skip-on-rhel-8 skip-on-fedora"
TESTTYPE="payload ostree skip-on-rhel"

. ${KSTESTDIR}/functions.sh

kernel_args() {
# Enforce the Fedora-Silverblue configuration.
echo ${DEFAULT_BOOTOPTS} inst.profile=fedora-silverblue
}

validate() {
# We are not able to copy files from the system.
# Look for the result in the logs we have.
Expand Down
20 changes: 12 additions & 8 deletions rpm-ostree-container.ks.in
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
#test name: rpm-ostree-container
# https://github.com/rhinstaller/anaconda/pull/4617
# https://github.com/rhinstaller/anaconda/pull/5399
#
# Test that ostreecontainer ks command works.
# Tests only installation of the palyload.
# Does not test that the installation is bootable.

# Use the default settings.
%ksappend common/common_no_payload.ks

# Set up the RPM OSTree source.
ostreecontainer --no-signature-verification --transport=registry --stateroot=fedora-silverblue --remote=fedora-silverblue --url=quay.io/fedora/fedora-silverblue:rawhide
%ksappend payload/ostreecontainer.ks

%post

if ! ostree remote list | grep -q "fedora-silverblue"; then
echo "Unexpected name fedora-silverblue in \"$(ostree remote list)\"" >> /root/RESULT
if [[ "@KSTEST_OS_NAME@" == "rhel" ]]; then
EXPECTED_URL="quay.io/centos-bootc/centos-bootc:stream9"
else
EXPECTED_URL="quay.io/centos-bootc/fedora-bootc:eln"
fi

# Check the url of the remote.
url="$(ostree remote show-url fedora-silverblue)"

if [ "${url}" != "quay.io/fedora/fedora-silverblue:rawhide" ]; then
url="$(ostree remote show-url default)"
if [ "${url}" != "${EXPECTED_URL}" ]; then
echo "Unexpected URL: ${url}" >> /root/RESULT
fi

Expand Down
9 changes: 2 additions & 7 deletions rpm-ostree-container.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2023 Red Hat, Inc.
# Copyright (C) 2024 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
Expand All @@ -19,15 +19,10 @@

# Ignore unused variable parsed out by tooling scripts as test tags metadata
# shellcheck disable=SC2034
TESTTYPE="payload ostree skip-on-rhel"
TESTTYPE="payload ostree skip-on-rhel-8"

. ${KSTESTDIR}/functions.sh

kernel_args() {
# Enforce the Fedora-Silverblue configuration.
echo ${DEFAULT_BOOTOPTS} inst.profile=fedora-silverblue
}

validate() {
# We are not able to copy files from the system.
# Look for the result in the logs we have.
Expand Down

0 comments on commit d4a32f4

Please sign in to comment.