Skip to content
Open
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
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"
Comment thread
LecrisUT marked this conversation as resolved.
<<: *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-virtual-image-mode
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
22 changes: 20 additions & 2 deletions tests/images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ 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-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 +103,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 +144,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 +167,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.

20 changes: 20 additions & 0 deletions tests/prepare/install/data/reboot-persistence.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
summary: Verify installed packages persist after reboot
description: |
Install packages and verify they survive a reboot.
This is critical for image mode where changes are applied
via Containerfile rebuild and bootc switch.

prepare:
- how: install
package:
- tree
- diffutils

execute:
how: tmt
script: |
tree --version
diff --version
if [ "$TMT_REBOOT_COUNT" == "0" ]; then
tmt-reboot
fi
1 change: 1 addition & 0 deletions tests/prepare/install/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tag+:
- provision-only
- provision-container
- provision-virtual
- image-mode

# TODO: what test cases are safe enough to be executed against the localhost?
# - provision-local
Loading
Loading