Skip to content
Draft
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
72 changes: 72 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,75 @@ build-base-branch:
.PHONY: robotidy
robotidy:
cd .. && make verify-rf

####################################################
# Testing Framework commands for local development #
####################################################

#
# Configuration commands
#
.PHONY: test-config-composer
test-config-composer:
./bin/manage_composer_config.sh cleanup
./bin/manage_composer_config.sh create
./bin/manage_composer_config.sh create-workers

.PHONY: test-config-hypervisor
test-config-hypervisor:
./bin/manage_hypervisor_config.sh cleanup
./bin/manage_hypervisor_config.sh create

.PHONY: test-cache-download
test-cache-download:
bash -euo pipefail -c '\
source ./bin/common.sh ; \
export AWS_BUCKET_NAME=microshift-build-cache-us-west-2 ; \
./bin/manage_build_cache.sh download -b "$${SCENARIO_BUILD_BRANCH}" -t "$${SCENARIO_BUILD_TAG}" ; \
'

# find_layer: finds a layer directory matching the token
# Usage: $(call find_layer,base_dir,token)
# Example: $(call find_layer,image-blueprints,base) returns ./image-blueprints/layer1-base
define find_layer
$(shell find $(1) -maxdepth 1 -type d -name '*$(2)' -print)
endef

#
# Build commands
#
.PHONY: test-build-registry-clean
test-build-registry-clean:
./bin/manage_composer_config.sh cleanup
rm -rf "$(REPO)/_output/test-images/mirror-registry"
./bin/manage_webserver.sh start

PHONY: test-build-ostree-presubmit
test-build-ostree-presubmit:
./bin/build_images.sh -l $(call find_layer,image-blueprints,base) $(ARGS)
./bin/build_images.sh -l $(call find_layer,image-blueprints,presubmit) $(ARGS)
Comment on lines +76 to +79
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing . prefix: PHONY should be .PHONY.

Line 76 declares PHONY: instead of .PHONY:, so test-build-ostree-presubmit won't actually be marked as phony. Make will treat PHONY as a real target.

Proposed fix
-PHONY: test-build-ostree-presubmit
+.PHONY: test-build-ostree-presubmit
🧰 Tools
🪛 checkmake (0.2.2)

[warning] 76-76: Target "PHONY" should be declared PHONY.

(phonydeclared)

🤖 Prompt for AI Agents
In `@test/Makefile` around lines 76 - 79, The Makefile declares PHONY: instead of
the special .PHONY: so the target test-build-ostree-presubmit is not marked as
phony; change the target declaration from PHONY to .PHONY and include
test-build-ostree-presubmit in that .PHONY list so Make treats
test-build-ostree-presubmit as a phony target rather than a real file.


.PHONY: test-build-ostree-periodic
test-build-ostree-periodic:
./bin/build_images.sh -l $(call find_layer,image-blueprints,periodic) $(ARGS)

.PHONY: test-build-ostree-release
test-build-ostree-release:
./bin/build_images.sh -l $(call find_layer,image-blueprints,release) $(ARGS)

.PHONY: test-build-bootc-presubmit
test-build-bootc-presubmit:
./bin/build_bootc_images.sh -l $(call find_layer,image-blueprints-bootc,base) $(ARGS)
./bin/build_bootc_images.sh -l $(call find_layer,image-blueprints-bootc,presubmit) $(ARGS)

.PHONY: test-build-bootc-periodic
test-build-bootc-periodic:
./bin/build_bootc_images.sh -l $(call find_layer,image-blueprints-bootc,periodic) $(ARGS)

.PHONY: test-build-bootc-release
test-build-bootc-release:
./bin/build_bootc_images.sh -l $(call find_layer,image-blueprints-bootc,release) $(ARGS)

.PHONY: test-build-bootc-upstream
test-build-bootc-upstream:
./bin/build_bootc_images.sh -l $(call find_layer,image-blueprints-bootc,upstream) $(ARGS)
2 changes: 1 addition & 1 deletion test/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ get_vm_bridge_ip() {
VM_BRIDGE_IP="$(get_vm_bridge_ip "default")"

# Web server port number
WEB_SERVER_PORT=8080
export WEB_SERVER_PORT=8080

# Web server URL using VM bridge IP with fallback to host name
# shellcheck disable=SC2034 # used elsewhere
Expand Down
3 changes: 2 additions & 1 deletion test/bin/manage_webserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ action_stop() {
}

action_start() {
echo "Starting web server in ${IMAGEDIR}"
mkdir -p "${IMAGEDIR}"
cd "${IMAGEDIR}"

Expand Down Expand Up @@ -76,6 +75,8 @@ EOF

# Restart the nginx web server
action_stop

echo "Starting web server in ${IMAGEDIR}"
nginx \
-c "${NGINX_CONFIG}" \
-e "${IMAGEDIR}/nginx.log"
Expand Down
8 changes: 7 additions & 1 deletion test/bin/pyutils/build_bootc_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,15 @@ def should_skip(image, cached):
# Note:
# - The pull secret is necessary in some builds for pulling embedded
# container images referenced in release-info RPMs
# - The host network usage is required to access the RPM repository
# proxy server using the localhost URL to make generated builds
# reusable from cache on other hosts.
# - The explicit push-to-mirror sets the 'latest' tag as all the build
# layers are in the mirror due to 'cache-to' option
build_args = [
"sudo", "podman", "build",
"--authfile", PULL_SECRET,
"--network", "host",
"--secret", f"id=pullsecret,src={PULL_SECRET}",
"--cache-to", f"{MIRROR_REGISTRY}/{cf_outname}",
"--cache-from", f"{MIRROR_REGISTRY}/{cf_outname}",
Expand Down Expand Up @@ -373,7 +377,8 @@ def should_skip(file):
# cached but not fetched from the mirror registry.
pull_args = [
"sudo", "podman", "pull",
"--authfile", PULL_SECRET, bf_imgref
"--authfile", PULL_SECRET,
bf_imgref
]
start = time.time()
common.retry_on_exception(3, common.run_command_in_shell, pull_args, dry_run, logfile, logfile)
Expand All @@ -384,6 +389,7 @@ def should_skip(file):
build_args = [
"sudo", "podman", "run",
"--rm", "-i", "--privileged",
"--network", "host",
"--pull=newer",
"--security-opt", "label=type:unconfined_t",
"-v", f"{bf_outdir}:/output",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{- if env.Getenv "CURRENT_RELEASE_VERSION" "" -}}
# Note: This comment makes templating add a new line before the code
FROM localhost/rhel96-test-agent:latest
FROM localhost/rhel98-test-agent:latest

# Copy repository configuration
COPY ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-crel.repo ./bootc-images/microshift-rhocp-y.repo \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{- if env.Getenv "CURRENT_RELEASE_VERSION" "" -}}
# Note: This comment makes templating add a new line before the code
FROM localhost/rhel96-test-agent:latest
FROM localhost/rhel98-test-agent:latest

# Copy repository configuration
COPY ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-crel.repo ./bootc-images/microshift-rhocp-y.repo \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{- if env.Getenv "CURRENT_RELEASE_VERSION" "" -}}
# Note: This comment makes templating add a new line before the code
FROM localhost/rhel96-test-agent:latest
FROM localhost/rhel98-test-agent:latest

# Copy repository configuration
COPY ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-crel.repo ./bootc-images/microshift-rhocp-y.repo \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-test-agent:latest
FROM localhost/rhel98-test-agent:latest

# Build arguments
ARG USHIFT_RPM_REPO_NAME=microshift-base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-test-agent:latest
FROM localhost/rhel98-test-agent:latest

# Build arguments
ARG USHIFT_RPM_REPO_NAME=microshift-local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest
# Create another label for the source container image without any changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest

# Build arguments
ARG USHIFT_RPM_REPO_NAME=microshift-fake-next-minor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest

# Add fips=1 kernel argument
# See https://containers.github.io/bootc/building/kernel-arguments.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest

# Build arguments
ARG USHIFT_RPM_REPO_NAME=microshift-local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{- if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) }}
# Currently, RHOAI is only available for x86_64
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest

# Build arguments
ARG USHIFT_RPM_REPO_NAME=microshift-local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest

# The qemu-guest-agent is used in offline tests
RUN dnf install -y qemu-guest-agent && \
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{- if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) }}
localhost/rhel96-bootc-source-ai-model-serving:latest
localhost/rhel98-bootc-source-ai-model-serving:latest
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM localhost/rhel96-bootc-source:latest
FROM localhost/rhel98-bootc-source:latest

# Copy repository configuration
COPY ./bootc-images/microshift-gitops.repo \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localhost/rhel98-bootc-source-isolated:latest
4 changes: 2 additions & 2 deletions test/package-sources-bootc/rhel98-mirror.repo
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[rhel-9.8-appstream]
name = rhel-9.8-appstream

baseurl = {{ .Env.WEB_SERVER_URL }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-appstream
baseurl = http://localhost:{{ .Env.WEB_SERVER_PORT }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-appstream
enabled = 1
sslverify = false
gpgcheck = 0
skip_if_unavailable = false

[rhel-9.8-baseos]
name = rhel-9.8-baseos
baseurl = {{ .Env.WEB_SERVER_URL }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-baseos
baseurl = http://localhost:{{ .Env.WEB_SERVER_PORT }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-baseos
enabled = 1
sslverify = false
gpgcheck = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ scenario_create_vms() {
exit_if_image_not_found "${start_image}"

prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
launch_vm --boot_blueprint rhel96-bootc
launch_vm --boot_blueprint rhel98-bootc
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check boot_blueprint and start_image patterns in scenario files
echo "=== Checking el9X@elYY upgrade scenarios ==="
fd -e sh test/scenarios-bootc/presubmits/ | grep '@' | while read file; do
  echo "--- $file ---"
  grep -E '(start_image|boot_blueprint)' "$file" | head -6
done

Repository: openshift/microshift

Length of output: 559


🏁 Script executed:

#!/bin/bash
# Fix: use correct fd syntax
echo "=== Checking upgrade scenarios (el9X@elYY pattern) ==="
fd '@' test/scenarios-bootc/presubmits/ --type f | while read file; do
  echo "--- $(basename "$file") ---"
  grep -E '(start_image|boot_blueprint)' "$file" | grep -v '^#'
  echo
done

Repository: openshift/microshift

Length of output: 2766


Change boot blueprint back to rhel96-bootc.

The boot blueprint should match the start image version. All other upgrade scenarios follow this pattern: el96-prel@el100-src uses rhel96-bootc, el98-src@el100-src uses rhel98-bootc. This file incorrectly pairs rhel96-bootc-prel (start) with rhel98-bootc (boot).

🤖 Prompt for AI Agents
In `@test/scenarios-bootc/presubmits/el96-prel`@el98-src@upgrade-ok.sh at line 11,
The boot blueprint is incorrect: the launch_vm call currently uses
--boot_blueprint rhel98-bootc but the scenario is el96-prel@el98-src and must
use the rhel96 boot blueprint; update the launch_vm invocation to use
--boot_blueprint rhel96-bootc (matching the start image) so the boot blueprint
aligns with the start image for the el96-prel scenario.

}

scenario_remove_vms() {
Expand All @@ -21,7 +21,7 @@ scenario_run_tests() {
exit_if_image_not_found "${start_image}"

run_tests host1 \
--variable "TARGET_REF:rhel96-bootc-source" \
--variable "TARGET_REF:rhel98-bootc-source" \
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
suites/upgrade/upgrade-successful.robot
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source-base
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-base
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
Expand All @@ -13,7 +13,7 @@ scenario_remove_vms() {

scenario_run_tests() {
run_tests host1 \
--variable "TARGET_REF:rhel96-bootc-source" \
--variable "TARGET_REF:rhel98-bootc-source" \
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
suites/upgrade/upgrade-successful.robot
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source-base
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-base
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
remove_vm host1
}

scenario_run_tests() {
prepare_static_delta rhel96-bootc-source-base rhel96-bootc-source
apply_static_delta rhel96-bootc-source-base rhel96-bootc-source
prepare_static_delta rhel98-bootc-source-base rhel98-bootc-source
apply_static_delta rhel98-bootc-source-base rhel98-bootc-source

prepare_static_delta rhel96-bootc-source rhel96-bootc-source-optionals
apply_static_delta rhel96-bootc-source rhel96-bootc-source-optionals
prepare_static_delta rhel98-bootc-source rhel98-bootc-source-optionals
apply_static_delta rhel98-bootc-source rhel98-bootc-source-optionals

for ref in rhel96-bootc-source-from-sdelta rhel96-bootc-source-optionals-from-sdelta ; do
for ref in rhel98-bootc-source-from-sdelta rhel98-bootc-source-optionals-from-sdelta ; do
run_tests host1 \
--variable "TARGET_REF:${ref}" \
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ scenario_create_vms() {
check_platform true

# Increased disk size because of the additional embedded images (especially OVMS which is ~3.5GiB)
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source-optionals
launch_vm --boot_blueprint rhel96-bootc --vm_disksize 30 --vm_vcpus 4
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-optionals
launch_vm --boot_blueprint rhel98-bootc --vm_disksize 30 --vm_vcpus 4
}

scenario_remove_vms() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source-fake-next-minor
launch_vm --boot_blueprint rhel96-bootc
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-fake-next-minor
launch_vm --boot_blueprint rhel98-bootc
}

scenario_remove_vms() {
Expand All @@ -13,7 +13,7 @@ scenario_remove_vms() {

scenario_run_tests() {
run_tests host1 \
--variable "OLDER_MICROSHIFT_REF:rhel96-bootc-source" \
--variable "OLDER_MICROSHIFT_REF:rhel98-bootc-source" \
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
suites/upgrade/downgrade-block.robot
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Sourced from scenario.sh and uses functions defined there.

scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source
launch_vm --boot_blueprint rhel96-bootc --network "${VM_DUAL_STACK_NETWORK}"
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
launch_vm --boot_blueprint rhel98-bootc --network "${VM_DUAL_STACK_NETWORK}"
}

scenario_remove_vms() {
Expand Down
Loading