Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5834492
Fixes #4606
thrix Mar 22, 2026
6571271
Addressed next round of review comments
thrix Mar 27, 2026
9ad9007
Move the is_image mode test next to is_ostree
thrix Mar 27, 2026
a7d1df9
Use for to iterate over a space delimited string
thrix Mar 27, 2026
5d907a4
Revert "Use for to iterate over a space delimited string"
thrix Mar 27, 2026
1b83ff5
The images should be newline separated
thrix Mar 27, 2026
4669839
Update .packit.yaml
thrix Mar 30, 2026
9110c67
Fix some tests
thrix Apr 7, 2026
2dac29c
fix tests
thrix Apr 8, 2026
7455d2d
Address a few review comments
thrix Apr 8, 2026
a8a4255
Address review comments, improve prepare/shell test
thrix Apr 8, 2026
f4999d0
Fix tests
thrix Apr 17, 2026
37de67a
Fix prepare shell tests
thrix Apr 17, 2026
8f7ef91
More anchors in packit.yaml, do not run irrelevants plans in image mode
thrix Apr 17, 2026
3e11748
Fix shell tests
thrix Apr 17, 2026
5db9370
Add todo item for #4806
thrix Apr 20, 2026
74e9fce
Update according to review
thrix Apr 20, 2026
64ff067
Fix `fetch_downloaded_packages` clobbering global `$image` variable
thrix Apr 20, 2026
1fbdbf2
Fix shell test to use paths reasonable for image mode
thrix Apr 20, 2026
378d37b
fixup
thrix Apr 21, 2026
0d534fb
fixup
thrix Apr 21, 2026
1adc5b1
fixup
thrix Apr 21, 2026
a99b165
Adjust packit job name, fix adjust rules to skip plans for image mode
thrix Apr 21, 2026
49f6d50
fix tests by limiting them to fedora
thrix Apr 21, 2026
c2bbc93
revert debugging code
thrix Apr 21, 2026
6e6f7b4
Move feature plugin package installs to Python for image mode support
thrix Apr 15, 2026
e4b6db0
fixup
thrix Apr 21, 2026
18609cf
Correct installation according to upstream docs
thrix Apr 21, 2026
2705357
enable virtual provisioner
thrix Apr 21, 2026
ff2257e
fix-tests
thrix Apr 21, 2026
e4dc3b1
fix wrong container images definition
thrix Apr 21, 2026
2526431
install epel-next also on RHEL9
thrix Apr 22, 2026
da86ce7
Add back workaround for RHEL8, it is fine for RHEL8
thrix Apr 22, 2026
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
17 changes: 16 additions & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,20 @@ _:
tf_extra_params:
environments:
- tmt:
context:
context: &provision-context
how: provision
<<: *tmt-cloud-resources

# Image mode
- &image-mode
tf_extra_params:
environments:
- tmt:
context:
<<: *provision-context
image_mode: "yes"
<<: *tmt-cloud-resources

jobs:
# Build released bits to stable
- <<: *copr-under-teemtee
Expand Down Expand Up @@ -176,6 +186,11 @@ jobs:
identifier: provision-virtual
tmt_plan: /plans/provision/virtual

- <<: *provision
<<: *image-mode
identifier: provision-image-mode-virtual
tmt_plan: /plans/provision/virtual

# Test internal plugins
- <<: *test-base
<<: *internal
Expand Down
18 changes: 18 additions & 0 deletions plans/provision/virtual.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,18 @@ adjust+:
because: Disable IPv6 in CI to avoid IPv6 connections that are disabled in CI
when: trigger == commit

- discover+:
filter: 'tag:provision-virtual & tag:image-mode'
environment+:
IMAGE_MODE: "yes"
when: image_mode == yes

/provision:
discover+:
test: "^/tests/provision"
adjust+:
- enabled: false
when: image_mode == yes

/prepare:
discover+:
Expand All @@ -77,11 +86,20 @@ adjust+:
discover+:
test: "^/tests/execute"
exclude: "^/tests/execute/upgrade"
adjust+:
- enabled: false
when: image_mode == yes

/upgrade:
discover+:
test: "^/tests/execute/upgrade"
adjust+:
- enabled: false
when: image_mode == yes

/the-rest:
discover+:
test: "^/tests/(?!provision|prepare|execute)"
adjust+:
- enabled: false
when: image_mode == yes
23 changes: 21 additions & 2 deletions tests/images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ fedora-coreos}"
# combinations, just make sure the basic functionality works.
TEST_VIRTUAL_IMAGES_SECONDARY="${TEST_VIRTUAL_IMAGES_SECONDARY:-fedora-42}"

# Base URL for image mode qcow2s
IMAGE_MODE_QCOW2_BASE_URL="https://artifacts.dev.testing-farm.io/images"

# Image mode QCOW2 images, with mapping to compatible container image used for artifacts downloading
declare -A IMAGE_MODE_QCOW2_CONTAINER_MAP
IMAGE_MODE_QCOW2_CONTAINER_MAP=(
["$IMAGE_MODE_QCOW2_BASE_URL/CentOS-Stream-9-image-mode-x86_64.qcow2"]="centos:stream9"
["$IMAGE_MODE_QCOW2_BASE_URL/CentOS-Stream-10-image-mode-x86_64.qcow2"]="centos:stream10"
["$IMAGE_MODE_QCOW2_BASE_URL/Fedora-44-image-mode-x86_64.qcow2"]="fedora:44"
)

# Set of image mode virtual images to test on.
TEST_IMAGE_MODE_IMAGES="${TEST_IMAGE_MODE_IMAGES:-$(printf "%s\n" "${!IMAGE_MODE_QCOW2_CONTAINER_MAP[@]}")}"

# A couple of "is image this?" helpers, to simplify conditions.
function is_fedora_rawhide () {
[[ "$1" =~ ^.*fedora/rawhide[:/].* ]] && return 0
Expand Down Expand Up @@ -90,6 +104,7 @@ function is_centos_stream_9 () {
function is_centos_stream_10 () {
[[ "$1" =~ ^.*centos/stream10[:/].* ]] && return 0
[[ "$1" = "centos-stream-10" ]] && return 0
[[ "$1" =~ CentOS-Stream-10 ]] && return 0

return 1
}
Expand Down Expand Up @@ -130,11 +145,11 @@ function is_fedora_coreos () {
}

function is_fedora () {
[[ "$1" =~ ^.*fedora.* ]] && return 0 || return 1
[[ "${1,,}" =~ ^.*fedora.* ]] && return 0 || return 1
}

function is_centos () {
[[ "$1" =~ ^.*centos.* ]] && return 0 || return 1
[[ "${1,,}" =~ ^.*centos.* ]] && return 0 || return 1
}

function is_rhel () {
Expand All @@ -153,6 +168,10 @@ function is_ubi_8 () {
[[ "$1" =~ ^.*ubi/8.* ]] && return 0 || return 1
}

function is_image_mode () {
[[ "$1" =~ image-mode ]]
}

function test_phase_prefix () {
if [ "$PROVISION_HOW" = "local" ]; then
echo "[$PROVISION_HOW]"
Expand Down
1 change: 0 additions & 1 deletion tests/prepare/bootc/data/.fmf/version

This file was deleted.

26 changes: 0 additions & 26 deletions tests/prepare/bootc/data/plans.fmf

This file was deleted.

9 changes: 0 additions & 9 deletions tests/prepare/bootc/data/test.fmf

This file was deleted.

16 changes: 0 additions & 16 deletions tests/prepare/bootc/main.fmf

This file was deleted.

60 changes: 0 additions & 60 deletions tests/prepare/bootc/test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tests/prepare/feature/crb/data/plans.fmf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
provision:
how: container
how: $PROVISION_HOW

execute:
how: tmt
Expand Down
2 changes: 2 additions & 0 deletions tests/prepare/feature/crb/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ description: Make sure enable/disable CRB works.
tag+:
- provision-container
- provision-only
- provision-virtual
- image-mode
84 changes: 50 additions & 34 deletions tests/prepare/feature/crb/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,67 @@
. /usr/share/beakerlib/beakerlib.sh || exit 1
. ../../../images.sh || exit 1

CONTAINER_IMAGES="$TEST_IMAGE_PREFIX/centos/stream9/upstream:latest
$TEST_IMAGE_PREFIX/ubi/8/upstream:latest
ubi9"

rlJournalStart "CRB Feature Test"
rlPhaseStartSetup
rlRun "PROVISION_HOW=${PROVISION_HOW:-container}"
rlRun "IMAGE_MODE=${IMAGE_MODE:-no}"

build_container_image "centos/stream9/upstream\:latest"
build_container_image "ubi/8/upstream\:latest"
build_container_image "fedora/latest\:latest"
if [ "$PROVISION_HOW" = "container" ]; then
build_container_image "centos/stream9/upstream\:latest"
build_container_image "ubi/8/upstream\:latest"
build_container_image "fedora/latest\:latest"
rlRun "IMAGES='$CONTAINER_IMAGES'"
elif [ "$PROVISION_HOW" = "virtual" ]; then
if [ "$IMAGE_MODE" = "yes" ]; then
rlRun "IMAGES='$TEST_IMAGE_MODE_IMAGES'"
else
rlRun "IMAGES='$TEST_VIRTUAL_IMAGES'"
fi
else
rlDie "Test supported only on containers or VMs"
fi

rlRun "pushd data"
rlPhaseEnd

images="$TEST_IMAGE_PREFIX/centos/stream9/upstream:latest $TEST_IMAGE_PREFIX/ubi/8/upstream:latest ubi9"

# CRB
for image in $images; do
# Run the '/crb/enabled' plan, overriding the provision image.
# The plan itself contains the check (dnf repolist enabled | grep ...).
# Expecting tmt run to succeed (exit code 0) as the check should pass.
rlPhaseStartTest "Test /crb/enabled on $image"
rlRun "tmt run --all provision --how container --image $image plan --name /crb/enabled" 0 "Run /crb/enabled plan for $image"
rlPhaseEnd

# Run the '/crb/disabled' plan, overriding the provision image.
# The plan itself contains the checks (! dnf repolist enabled ... && dnf repolist disabled ...).
# Expecting tmt run to succeed (exit code 0) as the checks should pass.
rlPhaseStartTest "Test /crb/disabled on $image"
rlRun "tmt run --all provision --how container --image $image plan --name /crb/disabled" 0 "Run /crb/disabled plan for $image"
rlPhaseEnd

# Run the '/crb_package' only on c9s
if is_centos_stream_9 "$image"; then
rlPhaseStartTest "Test /crb/crb_package on $image"
# This plan enables CRB and tries to install a package from it.
rlRun "tmt run --all provision --how container --image $image prepare execute plan --name /crb/crb_package" 0 "Run /crb/crb_package plan for $image"
while IFS= read -r image; do
if is_fedora "$image"; then
# Test Fedora for the warning message
rlPhaseStartTest "Test warning on $image"
# Run a CRB plan (just provision, prepare and finish) on fedora and verify the warning is shown
# We expect the tmt run to succeed (exit code 0) because it's a warning, not an error.
rlRun -s "tmt run provision --how $PROVISION_HOW --image $image prepare finish plan --name /crb/enabled" 0 "Run plan on fedora and capture output"
rlAssertGrep "CRB prepare feature is supported on RHEL/CentOS-Stream 8, 9 or 10." $rlRun_LOG
rlPhaseEnd
else
# Run the '/crb/enabled' plan, overriding the provision image.
# The plan itself contains the check (dnf repolist enabled | grep ...).
# Expecting tmt run to succeed (exit code 0) as the check should pass.
rlPhaseStartTest "Test /crb/enabled on $image"
rlRun "tmt run --all provision --how $PROVISION_HOW --image $image plan --name /crb/enabled" 0 "Run /crb/enabled plan for $image"
rlPhaseEnd

# Run the '/crb/disabled' plan, overriding the provision image.
# The plan itself contains the checks (! dnf repolist enabled ... && dnf repolist disabled ...).
# Expecting tmt run to succeed (exit code 0) as the checks should pass.
rlPhaseStartTest "Test /crb/disabled on $image"
rlRun "tmt run --all provision --how $PROVISION_HOW --image $image plan --name /crb/disabled" 0 "Run /crb/disabled plan for $image"
rlPhaseEnd

# Run the '/crb_package' only on c9s
if is_centos_stream_9 "$image"; then
rlPhaseStartTest "Test /crb/crb_package on $image"
# This plan enables CRB and tries to install a package from it.
rlRun "tmt run --all provision --how $PROVISION_HOW --image $image prepare execute plan --name /crb/crb_package" 0 "Run /crb/crb_package plan for $image"
rlPhaseEnd
fi
fi
done

# Test Fedora for the warning message
rlPhaseStartTest "Test warning on fedora:latest"
# Run a CRB plan (just provision, prepare and finish) on fedora and verify the warning is shown
# We expect the tmt run to succeed (exit code 0) because it's a warning, not an error.
rlRun -s "tmt run provision --how container --image $TEST_IMAGE_PREFIX/fedora/latest:latest prepare finish plan --name /crb/enabled" 0 "Run plan on fedora and capture output"
rlAssertGrep "CRB prepare feature is supported on RHEL/CentOS-Stream 8, 9 or 10." $rlRun_LOG
rlPhaseEnd
done <<< "$IMAGES"

rlPhaseStartCleanup
rlRun "popd"
Expand Down
3 changes: 3 additions & 0 deletions tests/prepare/feature/epel/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ description:
Make sure enable/disable EPEL works.
tag+:
- provision-container
- provision-only
- provision-virtual
- image-mode
Loading
Loading