-
Notifications
You must be signed in to change notification settings - Fork 232
USHIFT-6810: Add C2CC upgrade test for RHEL 9.8 to RHEL 10.2 #6894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vimauro
wants to merge
3
commits into
main
Choose a base branch
from
c2cc-upgrade-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/scenarios-bootc/el10/presubmits/el98-src@el102-src@c2cc-upgrade-ok.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| # shellcheck source=test/bin/c2cc_common.sh | ||
| source "${SCRIPTDIR}/c2cc_common.sh" | ||
|
|
||
| export TEST_RANDOMIZATION=none | ||
| export TEST_EXECUTION_TIMEOUT=60m | ||
|
|
||
| C2CC_TARGET_REF=rhel102-bootc-source | ||
|
|
||
| scenario_create_vms() { | ||
| c2cc_create_vms rhel98-bootc-source rhel98-bootc | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| c2cc_remove_vms | ||
| } | ||
|
|
||
| scenario_run_tests() { | ||
| # shellcheck disable=SC2119 | ||
| configure_c2cc_hosts | ||
| c2cc_run_tests "suites/upgrade/upgrade-c2cc.robot" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| *** Settings *** | ||
| Documentation Tests RHEL 9.8 to RHEL 10.2 upgrade with C2CC enabled across 3 clusters. | ||
| ... Upgrades each cluster one by one and verifies C2CC connectivity | ||
| ... survives at each stage. | ||
|
|
||
| Resource ../../resources/common.resource | ||
| Resource ../../resources/c2cc.resource | ||
| Resource ../../resources/microshift-host.resource | ||
| Library Collections | ||
| Library SSHLibrary | ||
|
|
||
| Suite Setup Setup | ||
| Suite Teardown Teardown | ||
|
|
||
| Test Tags c2cc ostree | ||
|
|
||
|
|
||
| *** Variables *** | ||
| ${TARGET_REF} ${EMPTY} | ||
| ${BOOTC_REGISTRY} ${EMPTY} | ||
| ${CLUSTER_A_POD_CIDR} ${EMPTY} | ||
| ${CLUSTER_A_SVC_CIDR} ${EMPTY} | ||
| ${CLUSTER_A_DOMAIN} ${EMPTY} | ||
| ${CLUSTER_B_POD_CIDR} ${EMPTY} | ||
| ${CLUSTER_B_SVC_CIDR} ${EMPTY} | ||
| ${CLUSTER_B_DOMAIN} ${EMPTY} | ||
| ${KUBECONFIG_B} ${EMPTY} | ||
| ${CLUSTER_C_POD_CIDR} ${EMPTY} | ||
| ${CLUSTER_C_SVC_CIDR} ${EMPTY} | ||
| ${CLUSTER_C_DOMAIN} ${EMPTY} | ||
| ${KUBECONFIG_C} ${EMPTY} | ||
|
|
||
|
|
||
| *** Test Cases *** | ||
| Upgrade C2CC Clusters From RHEL9 To RHEL10 | ||
| [Documentation] Upgrades 3 C2CC-connected clusters one by one from RHEL 9.8 | ||
| ... to RHEL 10.2 and verifies health and C2CC connectivity after each upgrade. | ||
|
|
||
| Verify All Clusters Healthy | ||
| Verify All RemoteClusters Healthy | ||
| Deploy Test Workloads | ||
| Verify Full C2CC Connectivity | ||
|
|
||
| FOR ${alias} IN cluster-a cluster-b cluster-c | ||
| Log To Console Upgrading ${alias} to ${TARGET_REF} | ||
| Upgrade Cluster ${alias} | ||
| Verify All Clusters Healthy | ||
| Verify All RemoteClusters Healthy | ||
| Wait For Test Pods | ||
| Wait For Service Endpoints | ||
| Verify Full C2CC Connectivity | ||
| END | ||
|
|
||
| [Teardown] Cleanup Test Workloads | ||
|
|
||
|
|
||
| *** Keywords *** | ||
| Setup | ||
| [Documentation] Register all three clusters for SSH and oc access | ||
| ... and store connection details for reconnection after reboots. | ||
| Check Required Env Variables | ||
| Should Not Be Empty ${TARGET_REF} TARGET_REF variable is required | ||
| Login MicroShift Host | ||
| Setup Kubeconfig | ||
| Logout MicroShift Host | ||
|
|
||
| Register Remote Cluster cluster-a ${USHIFT_HOST} ${SSH_PORT} ${KUBECONFIG} | ||
| Register Remote Cluster cluster-b ${HOST2_IP} ${HOST2_SSH_PORT} ${KUBECONFIG_B} | ||
| Register Remote Cluster cluster-c ${HOST3_IP} ${HOST3_SSH_PORT} ${KUBECONFIG_C} | ||
|
|
||
| Teardown | ||
| [Documentation] Close all connections and clean up. | ||
| Teardown All Remote Clusters | ||
| Remove Kubeconfig | ||
|
|
||
| Verify All Clusters Healthy | ||
| [Documentation] Verify all clusters are running and API server is reachable. | ||
| FOR ${alias} IN cluster-a cluster-b cluster-c | ||
| ${stdout}= Oc On Cluster ${alias} oc get --raw='/readyz' | ||
| Should Be Equal As Strings ${stdout} ok strip_spaces=True | ||
| END | ||
|
|
||
| Verify Full C2CC Connectivity | ||
| [Documentation] Verify pod-to-pod and pod-to-service connectivity between all cluster pairs. | ||
| @{clusters}= Create List cluster-a cluster-b cluster-c | ||
| FOR ${src} IN @{clusters} | ||
| FOR ${dst} IN @{clusters} | ||
| IF '${src}' != '${dst}' | ||
| Test Connectivity Between Clusters ${src} ${dst} pod | ||
| Test Connectivity Between Clusters ${src} ${dst} service | ||
| END | ||
| END | ||
| END | ||
|
|
||
| Upgrade Cluster | ||
| [Documentation] Upgrade a specific cluster to the target bootc image | ||
| ... and verify it booted into the new deployment without rollback. | ||
| [Arguments] ${alias} | ||
|
|
||
| ${initial_deploy_id}= Get Deployment Id On Cluster ${alias} | ||
|
|
||
| Command On Cluster | ||
| ... ${alias} | ||
| ... printf '[[registry]]\nlocation = "${BOOTC_REGISTRY}"\ninsecure = true\n' | sudo tee /etc/containers/registries.conf.d/999-microshift-insecure-registry.conf > /dev/null | ||
|
|
||
| Command On Cluster ${alias} bootc switch --quiet ${BOOTC_REGISTRY}/${TARGET_REF} | ||
|
|
||
| Command On Cluster ${alias} | ||
| ... rm -f /etc/containers/registries.conf.d/999-microshift-insecure-registry.conf | ||
|
|
||
| Reboot Cluster And Wait ${alias} | ||
|
|
||
| ${current_deploy_id}= Get Deployment Id On Cluster ${alias} | ||
| Should Not Be Equal As Strings ${current_deploy_id} ${initial_deploy_id} | ||
| ... msg=${alias} rolled back to initial deployment | ||
|
|
||
| Get Deployment Id On Cluster | ||
| [Documentation] Get the booted image digest from a specific cluster. | ||
| [Arguments] ${alias} | ||
| ${stdout}= Command On Cluster | ||
| ... ${alias} | ||
| ... bootc status --booted --json | python3 -c "import sys,json; print(json.load(sys.stdin)['status']['booted']['image']['imageDigest'])" | ||
| RETURN ${stdout} | ||
|
|
||
| Reboot Cluster And Wait | ||
| [Documentation] Reboot a cluster and wait for it to come back with greenboot healthy. | ||
| [Arguments] ${alias} | ||
|
|
||
| ${boot_id}= Command On Cluster ${alias} | ||
| ... cat /proc/sys/kernel/random/boot_id sudo_mode=False | ||
|
|
||
| Disruptive Command On Cluster ${alias} reboot | ||
|
|
||
| Wait Until Keyword Succeeds 10m 15s | ||
| ... Cluster Rebooted And Healthy ${alias} ${boot_id} | ||
|
|
||
| Cluster Rebooted And Healthy | ||
| [Documentation] Verify cluster has rebooted and greenboot health check passed. | ||
| [Arguments] ${alias} ${old_boot_id} | ||
|
|
||
| ${old_conn_id}= Get From Dictionary ${C2CC_SSH_IDS} ${alias} | ||
| ${status}= Run Keyword And Return Status | ||
| ... SSHLibrary.Switch Connection ${old_conn_id} | ||
| IF ${status} SSHLibrary.Close Connection | ||
|
|
||
| ${host} ${port} ${kc}= Get Cluster Connection Info ${alias} | ||
| Remove Values From List ${C2CC_REMOTE_ALIASES} ${alias} | ||
| Register Remote Cluster ${alias} ${host} ${port} ${kc} | ||
|
|
||
| ${new_boot_id}= Command On Cluster ${alias} | ||
| ... cat /proc/sys/kernel/random/boot_id sudo_mode=False | ||
| Should Not Be Equal As Strings ${old_boot_id} ${new_boot_id} strip_spaces=True | ||
|
|
||
| ${stdout}= Command On Cluster ${alias} | ||
| ... systemctl show -p SubState greenboot-healthcheck.service --value | ||
| Should Be Equal As Strings ${stdout} exited strip_spaces=True | ||
|
|
||
| Get Cluster Connection Info | ||
| [Documentation] Return host, port, and kubeconfig for a given cluster alias. | ||
| [Arguments] ${alias} | ||
| IF '${alias}' == 'cluster-a' | ||
| RETURN ${USHIFT_HOST} ${SSH_PORT} ${KUBECONFIG} | ||
| ELSE IF '${alias}' == 'cluster-b' | ||
| RETURN ${HOST2_IP} ${HOST2_SSH_PORT} ${KUBECONFIG_B} | ||
| ELSE IF '${alias}' == 'cluster-c' | ||
| RETURN ${HOST3_IP} ${HOST3_SSH_PORT} ${KUBECONFIG_C} | ||
| ELSE | ||
| Fail Unknown cluster alias: ${alias} | ||
| END | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.