Skip to content

Commit bda922e

Browse files
committed
add 2 new scenarios to test latest released bootc image available from mirror.openshift.com repo
1 parent 6bedfdf commit bda922e

File tree

3 files changed

+106
-4
lines changed

3 files changed

+106
-4
lines changed

test/bin/common_versions.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,19 @@ export BREW_Y2_RELEASE_VERSION
147147
export BREW_RC_RELEASE_VERSION
148148
export BREW_EC_RELEASE_VERSION
149149

150-
# Set the release type to ec, rc or zstream
151-
LATEST_RELEASE_TYPE="ec"
150+
# Latest Release info
151+
LATEST_RELEASE_TYPE="ec" # ec, rc or zstream
152+
BREW_LREL_RELEASE_VERSION="${BREW_EC_RELEASE_VERSION}" # BREW_EC_RELEASE_VERSION, BREW_RC_RELEASE_VERSION or BREW_Y0_RELEASE_VERSION
153+
LATEST_RELEASE_VERSION="$(echo "${BREW_LREL_RELEASE_VERSION}" | sed -E 's/(.*)-.*/\1/' | sed -E 's/(.*)~(.*)/\1-\2/')" # example: 4.19.7 or 4.20.0-rc.3
154+
if [[ "${LATEST_RELEASE_TYPE}" == "ec" ]]; then
155+
KONFLUX_LREL_RELEASE_IMAGE_URL="https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/microshift/ocp-dev-preview/${LATEST_RELEASE_VERSION}/el9/bootc-pullspec.txt"
156+
else
157+
KONFLUX_LREL_RELEASE_IMAGE_URL="https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/microshift/ocp/${LATEST_RELEASE_VERSION}/el9/bootc-pullspec.txt"
158+
fi
152159
export LATEST_RELEASE_TYPE
153-
154-
BREW_LREL_RELEASE_VERSION="${BREW_EC_RELEASE_VERSION}"
155160
export BREW_LREL_RELEASE_VERSION
161+
export LATEST_RELEASE_VERSION
162+
export KONFLUX_LREL_RELEASE_IMAGE_URL
156163

157164
# Branch and commit for the openshift-tests-private repository
158165
OPENSHIFT_TESTS_PRIVATE_REPO_BRANCH="release-4.${MINOR_VERSION}"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# Enable container signature verification for published MicroShift images.
6+
# These are ec / rc / z-stream, thus guaranteed to be signed.
7+
# shellcheck disable=SC2034 # used elsewhere
8+
IMAGE_SIGSTORE_ENABLED=true
9+
10+
scenario_create_vms() {
11+
if [[ "${KONFLUX_LREL_RELEASE_IMAGE_URL}" == "" ]] ; then
12+
# Empty string means there's no bootc image build yet, so the test needs to be skipped.
13+
exit 0
14+
fi
15+
16+
local -r bootc_spec="$(curl -s "${KONFLUX_LREL_RELEASE_IMAGE_URL}")"
17+
if [ -z "${bootc_spec}" ] || [[ "${bootc_spec}" != quay.io/openshift* ]] ; then
18+
echo "ERROR: Failed to retrieve a bootc pull spec from '${KONFLUX_LREL_RELEASE_IMAGE_URL}'"
19+
exit 1
20+
fi
21+
prepare_kickstart host1 kickstart-bootc.ks.template "${bootc_spec}"
22+
launch_vm --boot_blueprint rhel96-bootc
23+
24+
# Open the firewall ports. Other scenarios get this behavior by embedding
25+
# settings in the blueprint, but we cannot open firewall ports in published
26+
# images. We need to do this step before running the RF suite so that suite
27+
# can assume it can reach all of the same ports as for any other test.
28+
configure_vm_firewall host1
29+
}
30+
31+
scenario_remove_vms() {
32+
if [[ "${CURRENT_RELEASE_REPO}" == "" ]] ; then
33+
# Empty string means there's no EC build yet, so the test needs to be skipped.
34+
exit 0
35+
fi
36+
remove_vm host1
37+
}
38+
39+
scenario_run_tests() {
40+
if [[ "${CURRENT_RELEASE_REPO}" == "" ]] ; then
41+
# Empty string means there's no EC build yet, so the test needs to be skipped.
42+
exit 0
43+
fi
44+
run_tests host1 \
45+
--variable "EXPECTED_OS_VERSION:9.6" \
46+
--variable "IMAGE_SIGSTORE_ENABLED:True" \
47+
suites/standard1/ suites/selinux/validate-selinux-policy.robot
48+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# Enable container signature verification for published MicroShift images.
6+
# These are ec / rc / z-stream, thus guaranteed to be signed.
7+
# shellcheck disable=SC2034 # used elsewhere
8+
IMAGE_SIGSTORE_ENABLED=true
9+
10+
scenario_create_vms() {
11+
if [[ "${KONFLUX_LREL_RELEASE_IMAGE_URL}" == "" ]] ; then
12+
# Empty string means there's no bootc image build yet, so the test needs to be skipped.
13+
exit 0
14+
fi
15+
16+
local -r bootc_spec="$(curl -s "${KONFLUX_LREL_RELEASE_IMAGE_URL}")"
17+
if [ -z "${bootc_spec}" ] || [[ "${bootc_spec}" != quay.io/openshift* ]] ; then
18+
echo "ERROR: Failed to retrieve a bootc pull spec from '${KONFLUX_LREL_RELEASE_IMAGE_URL}'"
19+
exit 1
20+
fi
21+
prepare_kickstart host1 kickstart-bootc.ks.template "${bootc_spec}"
22+
launch_vm --boot_blueprint rhel96-bootc
23+
24+
# Open the firewall ports. Other scenarios get this behavior by embedding
25+
# settings in the blueprint, but we cannot open firewall ports in published
26+
# images. We need to do this step before running the RF suite so that suite
27+
# can assume it can reach all of the same ports as for any other test.
28+
configure_vm_firewall host1
29+
}
30+
31+
scenario_remove_vms() {
32+
if [[ "${CURRENT_RELEASE_REPO}" == "" ]] ; then
33+
# Empty string means there's no EC build yet, so the test needs to be skipped.
34+
exit 0
35+
fi
36+
remove_vm host1
37+
}
38+
39+
scenario_run_tests() {
40+
if [[ "${CURRENT_RELEASE_REPO}" == "" ]] ; then
41+
# Empty string means there's no EC build yet, so the test needs to be skipped.
42+
exit 0
43+
fi
44+
run_tests host1 \
45+
--variable "IMAGE_SIGSTORE_ENABLED:True" \
46+
suites/standard2/
47+
}

0 commit comments

Comments
 (0)