Skip to content

Commit 164408c

Browse files
Merge pull request #5327 from agullon/USHIFT-5975
USHIFT-5975: Create releases scenarios
2 parents 052ecc6 + 78d8591 commit 164408c

27 files changed

+613
-2
lines changed

test/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,8 @@ $ ./test/bin/scenario.sh run \
475475
476476
### Scenario Definitions
477477
478-
Scenarios are saved as shell scripts under `./test/scenarios` and
479-
`./test/scenarios-periodics`.
478+
Scenarios are saved as shell scripts under `./test/scenarios`,
479+
`./test/scenarios-bootc` and `./test/scenarios-bootc-containers`.
480480
Each scenario includes several functions that are combined
481481
with the framework scripts to take the specific actions for the
482482
combination of images and tests that make up the scenario.
@@ -511,13 +511,16 @@ Scenarios utilize following distinct MicroShift sources:
511511
- `crel`: current MicroShift minor release (already built and released
512512
RPMs like ECs, RCs, Z-stream). It is optional meaning that shortly after
513513
branch cut, before first EC is released, it will be skipped.
514+
- `lrel`: latest available release (EC, RC or zstream) available from internal
515+
Red Hat repositories (staging).
514516
515517
| Starting ref | End ref | Successful upgrade scenario | Failed upgrade scenario |
516518
|--------------|---------|-----------------------------|-------------------------|
517519
| `base` | `src` |`[email protected]` | **MISSING** |
518520
| `prel` | `src` |`[email protected]` | **MISSING** |
519521
| `src` | `src` | **MISSING** | `[email protected]` |
520522
| `crel` | `src` | `[email protected]` | `[email protected]` |
523+
| `y1` | `lrel` | `el96-y1@[email protected]` | **MISSING** |
521524
522525
#### scenario_create_vms
523526

test/bin/common_versions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,7 @@ export BREW_Y2_RELEASE_VERSION
136136
export BREW_RC_RELEASE_VERSION
137137
export BREW_EC_RELEASE_VERSION
138138
export BREW_NIGHTLY_RELEASE_VERSION
139+
140+
# Set the release type to ec, rc or zstream
141+
LATEST_RELEASE_TYPE="ec"
142+
export LATEST_RELEASE_TYPE
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# NOTE: Unlike most suites, these tests rely on being run IN ORDER to
6+
# ensure MicroShift is upgraded before running standard suite tests
7+
export TEST_RANDOMIZATION=none
8+
9+
dest_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
10+
11+
scenario_create_vms() {
12+
if ! does_image_exist "${dest_image}"; then
13+
echo "Image '${dest_image}' not found - skipping test"
14+
return 0
15+
fi
16+
prepare_kickstart host1 kickstart-bootc.ks.template rhel94-bootc-brew-y2-with-optional
17+
launch_vm --boot_blueprint rhel94-bootc
18+
}
19+
20+
scenario_remove_vms() {
21+
if ! does_image_exist "${dest_image}"; then
22+
echo "Image '${dest_image}' not found - skipping test"
23+
return 0
24+
fi
25+
remove_vm host1
26+
}
27+
28+
scenario_run_tests() {
29+
if ! does_image_exist "${dest_image}"; then
30+
echo "Image '${dest_image}' not found - skipping test"
31+
return 0
32+
fi
33+
run_tests host1 \
34+
--variable "TARGET_REF:${dest_image}" \
35+
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
36+
--variable "EXPECTED_OS_VERSION:9.6" \
37+
suites/upgrade/upgrade-successful.robot \
38+
suites/standard1/
39+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# NOTE: Unlike most suites, these tests rely on being run IN ORDER to
6+
# ensure MicroShift is upgraded before running standard suite tests
7+
export TEST_RANDOMIZATION=none
8+
9+
dest_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
10+
11+
scenario_create_vms() {
12+
if ! does_image_exist "${dest_image}"; then
13+
echo "Image '${dest_image}' not found - skipping test"
14+
return 0
15+
fi
16+
prepare_kickstart host1 kickstart-bootc.ks.template rhel94-bootc-brew-y2-with-optional
17+
launch_vm --boot_blueprint rhel94-bootc
18+
}
19+
20+
scenario_remove_vms() {
21+
if ! does_image_exist "${dest_image}"; then
22+
echo "Image '${dest_image}' not found - skipping test"
23+
return 0
24+
fi
25+
remove_vm host1
26+
}
27+
28+
scenario_run_tests() {
29+
if ! does_image_exist "${dest_image}"; then
30+
echo "Image '${dest_image}' not found - skipping test"
31+
return 0
32+
fi
33+
run_tests host1 \
34+
--variable "TARGET_REF:${dest_image}" \
35+
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
36+
suites/upgrade/upgrade-successful.robot \
37+
suites/standard2
38+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# Currently, RHOAI is only available for x86_64
6+
check_platform() {
7+
local -r record_junit=${1:-false}
8+
9+
if [[ "${UNAME_M}" =~ aarch64 ]]; then
10+
if "${record_junit}"; then
11+
record_junit "setup" "scenario_create_vms" "SKIPPED"
12+
fi
13+
exit 0
14+
fi
15+
}
16+
17+
scenario_create_vms() {
18+
check_platform true
19+
20+
# Increased disk size because of the additional embedded images (especially OVMS which is ~3.5GiB)
21+
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
22+
launch_vm --boot_blueprint rhel96-bootc --vm_disksize 30
23+
}
24+
25+
scenario_remove_vms() {
26+
check_platform
27+
28+
remove_vm host1
29+
}
30+
31+
scenario_run_tests() {
32+
check_platform
33+
34+
run_tests host1 \
35+
suites/ai-model-serving/ai-model-serving-online.robot
36+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
scenario_create_vms() {
6+
prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
7+
launch_vm --boot_blueprint rhel96-bootc --network "${VM_DUAL_STACK_NETWORK}"
8+
}
9+
10+
scenario_remove_vms() {
11+
remove_vm host1
12+
}
13+
14+
scenario_run_tests() {
15+
local -r vmname=$(full_vm_name host1)
16+
# Valid IP addresses are the first two entries returned by manage-vm script.
17+
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
18+
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -2 | tail -1)
19+
20+
run_tests host1 \
21+
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
22+
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
23+
suites/ipv6/dualstack.robot
24+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# Redefine network-related settings to use the dedicated IPv6 network bridge
6+
# shellcheck disable=SC2034 # used elsewhere
7+
VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_IPV6_NETWORK}")"
8+
# shellcheck disable=SC2034 # used elsewhere
9+
WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}"
10+
# Using `hostname` here instead of a raw ip because skopeo only allows either
11+
# ipv4 or fqdn's, but not ipv6. Since the registry is hosted on the ipv6
12+
# network gateway in the host, we need to use a combination of the hostname
13+
# plus /etc/hosts resolution (which is taken care of by kickstart).
14+
# shellcheck disable=SC2034 # used elsewhere
15+
MIRROR_REGISTRY_URL="$(hostname):${MIRROR_REGISTRY_PORT}/microshift"
16+
17+
scenario_create_vms() {
18+
# Enable IPv6 single stack in kickstart
19+
prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" false true
20+
launch_vm --boot_blueprint rhel96-bootc --network "${VM_IPV6_NETWORK}"
21+
}
22+
23+
scenario_remove_vms() {
24+
remove_vm host1
25+
}
26+
27+
scenario_run_tests() {
28+
run_tests host1 suites/ipv6/singlestack.robot
29+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
scenario_create_vms() {
6+
prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
7+
# Using multus as secondary network to have 2 nics in different networks.
8+
launch_vm --boot_blueprint rhel96-bootc --network default,"${VM_MULTUS_NETWORK}"
9+
}
10+
11+
scenario_remove_vms() {
12+
remove_vm host1
13+
}
14+
15+
scenario_run_tests() {
16+
local -r vmname=$(full_vm_name host1)
17+
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
18+
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1)
19+
20+
run_tests host1 \
21+
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
22+
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
23+
suites/network/multi-nic.robot
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
scenario_create_vms() {
6+
prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
7+
launch_vm --boot_blueprint rhel96-bootc
8+
}
9+
10+
scenario_remove_vms() {
11+
remove_vm host1
12+
}
13+
14+
scenario_run_tests() {
15+
run_tests host1 \
16+
suites/router
17+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
scenario_create_vms() {
6+
prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional"
7+
launch_vm --boot_blueprint rhel96-bootc
8+
}
9+
10+
scenario_remove_vms() {
11+
remove_vm host1
12+
}
13+
14+
scenario_run_tests() {
15+
run_tests host1 \
16+
--variable "EXPECTED_OS_VERSION:9.6" \
17+
suites/standard1/ suites/selinux/validate-selinux-policy.robot
18+
}

0 commit comments

Comments
 (0)