Skip to content
Merged
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
7 changes: 0 additions & 7 deletions test/bin/c2cc_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ c2cc_run_tests() {
local -r suites_dir="${1}"
local -r foreign_cidr="${2:-}"
local -r ip_family="${3:-}"
local -r include_tags="${4:-c2cc}"

local include_args=""
for tag in ${include_tags}; do
include_args+="--include ${tag} "
done

local foreign_cidr_var=""
if [ -n "${foreign_cidr}" ]; then
Expand Down Expand Up @@ -324,7 +318,6 @@ c2cc_run_tests() {
${target_ref_var} \
${dual_cidr_vars} \
--variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \
${include_args} \
"${suites_dir}"
}

Expand Down
139 changes: 104 additions & 35 deletions test/resources/c2cc.resource
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ Wait For Service Endpoints
... Ensures OVN-K has synced the EndpointSlice and programmed the OVN load balancer.
FOR ${alias} IN cluster-a cluster-b cluster-c
Wait Until Keyword Succeeds 120s 5s
... Service Endpoints Should Exist ${alias} ${NAMESPACES}[${alias}]
... Verify Service Endpoints Exist ${alias} ${NAMESPACES}[${alias}]
END

Service Endpoints Should Exist
Verify Service Endpoints Exist
[Documentation] Verify the hello-microshift endpoint has at least one address.
[Arguments] ${alias} ${ns}
${stdout}= Oc On Cluster ${alias}
Expand Down Expand Up @@ -418,7 +418,7 @@ Curl From Cluster
... oc exec curl-pod -n ${NAMESPACES}[${alias}] -- curl -sS --max-time 10 ${url}
RETURN ${stdout}

Test Connectivity Between Clusters
Verify Connectivity Between Clusters
[Documentation] Verify pod on ${source} can reach ${endpoint_type} IP on ${destination}.
[Arguments] ${source} ${destination} ${endpoint_type}
IF '${endpoint_type}' == 'pod'
Expand All @@ -431,7 +431,7 @@ Test Connectivity Between Clusters
${stdout}= Curl From Cluster ${source} ${ip_dest} 8080
Should Contain ${stdout} Hello from

Test Source IP Preserved Between Clusters
Verify Source IP Preserved Between Clusters
[Documentation] Verify ${source} to ${destination} pod-to-${endpoint_type} traffic preserves the source pod IP (no SNAT).
[Arguments] ${source} ${destination} ${endpoint_type}
IF '${endpoint_type}' == 'pod'
Expand All @@ -445,7 +445,7 @@ Test Source IP Preserved Between Clusters
${stdout}= Curl From Cluster ${source} ${ip_dest} 8080
Should Contain ${stdout} source: ${curl_pod_ip}

Test Dual Stack Connectivity Between Clusters
Verify Dual Stack Connectivity Between Clusters
[Documentation] Verify pod on ${source} can reach ${endpoint_type} dual-stack IP on ${destination}.
[Arguments] ${source} ${destination} ${endpoint_type}
IF '${endpoint_type}' == 'pod'
Expand All @@ -458,7 +458,7 @@ Test Dual Stack Connectivity Between Clusters
${stdout}= Curl From Cluster ${source} ${ip_dest} 8080
Should Contain ${stdout} Hello from

Test Dual Stack Source IP Preserved Between Clusters
Verify Dual Stack Source IP Preserved Between Clusters
[Documentation] Verify dual-stack traffic preserves the source pod IP (no SNAT).
[Arguments] ${source} ${destination} ${endpoint_type}
IF '${endpoint_type}' == 'pod'
Expand All @@ -472,13 +472,13 @@ Test Dual Stack Source IP Preserved Between Clusters
${stdout}= Curl From Cluster ${source} ${ip_dest} 8080
Should Contain ${stdout} source: ${curl_pod_ip}

DNS Resolve From Cluster
Verify DNS Resolution From Cluster
[Documentation] Resolve a DNS name from curl-pod on the given cluster. Retries for up to 60s.
[Arguments] ${alias} ${fqdn}
Wait Until Keyword Succeeds 12x 5s
... DNS Lookup Should Succeed ${alias} ${fqdn}
... Verify DNS Lookup ${alias} ${fqdn}

DNS Lookup Should Succeed
Verify DNS Lookup
[Documentation] Resolve a DNS name from curl-pod using getent hosts.
[Arguments] ${alias} ${fqdn}
${stdout}= Oc On Cluster ${alias}
Expand All @@ -492,25 +492,25 @@ Verify All RemoteClusters Healthy
... Verify RemoteCluster State ${alias} Healthy
END

Curl DNS From Cluster
Verify Curl DNS From Cluster
[Documentation] Curl a service by DNS name from curl-pod on the given cluster.
[Arguments] ${alias} ${fqdn} ${port}
${stdout}= Wait Until Keyword Succeeds 12x 5s
... Curl DNS Should Succeed ${alias} ${fqdn} ${port}
... Verify Curl DNS ${alias} ${fqdn} ${port}
RETURN ${stdout}

Curl DNS Should Succeed
Verify Curl DNS
[Documentation] Single attempt to curl a DNS name from curl-pod.
[Arguments] ${alias} ${fqdn} ${port}
${stdout}= Oc On Cluster ${alias}
... oc exec curl-pod -n ${NAMESPACES}[${alias}] -- curl -sS --max-time 10 http://${fqdn}:${port}/cgi-bin/hello
Should Contain ${stdout} Hello from
RETURN ${stdout}

Curl Remote Service Via DNS
Verify Remote Service Via DNS
[Documentation] Verify pod on ${source} can reach a service on ${destination} using the remote DNS name.
[Arguments] ${source} ${destination}
${stdout}= Curl DNS From Cluster ${source}
${stdout}= Verify Curl DNS From Cluster ${source}
... hello-microshift.${NAMESPACES}[${destination}].svc.${DOMAIN_MAP}[${destination}] 8080
Should Contain ${stdout} Hello from

Expand Down Expand Up @@ -576,13 +576,14 @@ IP Command For CIDR
RETURN ${cmd}

Verify C2CC Infrastructure For Remote
[Documentation] Verify C2CC infrastructure for one remote cluster's CIDRs.
[Documentation] Verify all C2CC infrastructure for one remote cluster's CIDRs.
[Arguments] ${alias} ${remote_pod_cidr} ${remote_svc_cidr} ${local_svc_cidr} ${ip_cmd}=${IP_CMD}
Verify Routes In Table 200 ${alias} ${remote_pod_cidr} ${remote_svc_cidr} ${ip_cmd}
Verify All IP Rules ${alias} ${remote_pod_cidr} ${remote_svc_cidr} ${local_svc_cidr} ${ip_cmd}
Verify NFTables Bypass Rules ${alias} ${remote_pod_cidr} ${remote_svc_cidr}
Verify OVN Static Routes ${alias} ${remote_pod_cidr} ${remote_svc_cidr}
Verify Node SNAT Annotation ${alias} ${remote_pod_cidr} ${remote_svc_cidr}
Verify C2CC Tracking Annotation ${alias} ${remote_pod_cidr} ${remote_svc_cidr}

Verify C2CC Infrastructure On Cluster
[Documentation] Run all C2CC infrastructure checks for all remote CIDRs on the given cluster.
Expand All @@ -608,29 +609,13 @@ Verify C2CC Infrastructure For CIDR Family
END
Verify Routes In Table 201 ${alias} ${local_svc_cidr} ${ip_cmd}

Verify Cross Cluster Connectivity
[Documentation] Verify a representative subset of cross-cluster connectivity.
... Tests one direction per cluster pair, alternating pod/service.
Test Connectivity Between Clusters cluster-a cluster-b pod
Test Connectivity Between Clusters cluster-a cluster-c service
Test Connectivity Between Clusters cluster-b cluster-a service
Test Connectivity Between Clusters cluster-b cluster-c pod
Test Connectivity Between Clusters cluster-c cluster-a pod
Test Connectivity Between Clusters cluster-c cluster-b service

Verify Cross Cluster DNS
[Documentation] Verify a representative subset of cross-cluster DNS resolution.
Curl Remote Service Via DNS cluster-a cluster-b
Curl Remote Service Via DNS cluster-b cluster-c
Curl Remote Service Via DNS cluster-c cluster-a

Wait For OVN-K Pods Ready On Cluster
[Documentation] Wait for all OVN-K pods to be Running and Ready on the given cluster.
[Arguments] ${alias} ${timeout}=5m ${retry}=15s
Wait Until Keyword Succeeds ${timeout} ${retry}
... OVN-K Pods Should Be Ready ${alias}
... Verify OVN-K Pods Ready ${alias}

OVN-K Pods Should Be Ready
Verify OVN-K Pods Ready
[Documentation] Assert all pods in openshift-ovn-kubernetes are Ready.
[Arguments] ${alias}
Oc On Cluster ${alias}
Expand Down Expand Up @@ -698,10 +683,10 @@ Reboot Clusters Simultaneously
FOR ${alias} IN @{cluster_aliases}
${old_bootid}= Get From Dictionary ${boot_ids} ${alias}
Wait Until Keyword Succeeds 10m 15s
... Cluster Should Be Rebooted ${alias} ${old_bootid}
... Verify Cluster Has Rebooted ${alias} ${old_bootid}
END

Cluster Should Be Rebooted
Verify Cluster Has Rebooted
[Documentation] Assert that a cluster has rebooted and greenboot health check has passed.
[Arguments] ${alias} ${old_bootid}
Reconnect Cluster ${alias}
Expand Down Expand Up @@ -731,3 +716,87 @@ Reconnect Cluster
END
${kubeconfig}= Get From Dictionary ${C2CC_KUBECONFIGS} ${alias}
Reconnect To Cluster ${alias} ${host} ${port} ${kubeconfig} timeout=10m

C2CC Suite Setup
[Documentation] Standard 3-cluster suite setup: registers all three clusters
... as remote and optionally deploys test workloads.
[Arguments] ${deploy_workloads}=${FALSE}
Check Required Env Variables
Register All C2CC Clusters
IF ${deploy_workloads} Deploy Test Workloads

C2CC Suite Teardown
[Documentation] Standard suite teardown: optionally cleans up workloads
... and tears down remote clusters.
[Arguments] ${cleanup_workloads}=${FALSE}
IF ${cleanup_workloads} Cleanup Test Workloads
Teardown All Remote Clusters

Verify Full C2CC Connectivity
[Documentation] Verify pod-to-pod, pod-to-service connectivity and source IP preservation
... across all 6 cluster pairs.
FOR ${src} ${dst} IN
... cluster-a cluster-b
... cluster-a cluster-c
... cluster-b cluster-a
... cluster-b cluster-c
... cluster-c cluster-a
... cluster-c cluster-b
Verify Connectivity Between Clusters ${src} ${dst} pod
Verify Connectivity Between Clusters ${src} ${dst} service
Verify Source IP Preserved Between Clusters ${src} ${dst} pod
Verify Source IP Preserved Between Clusters ${src} ${dst} service
END

Verify Full C2CC DNS
[Documentation] Verify CoreDNS Corefile contains C2CC server blocks and
... cross-cluster DNS resolution works for all pairs.
FOR ${alias} IN @{ALL_CLUSTERS}
FOR ${remote} IN @{ALL_CLUSTERS}
IF '${remote}' != '${alias}'
${domain}= Get From Dictionary ${DOMAIN_MAP} ${remote}
Verify Corefile Contains C2CC Server Block ${alias} ${domain}
END
END
END
FOR ${src} ${dst} IN
... cluster-a cluster-b
... cluster-a cluster-c
... cluster-b cluster-a
... cluster-b cluster-c
... cluster-c cluster-a
... cluster-c cluster-b
Verify Remote Service Via DNS ${src} ${dst}
END

Verify C2CC Health Probes
[Documentation] Verify all RemoteCluster CRs report Healthy with populated timestamps.
FOR ${alias} IN @{ALL_CLUSTERS}
Verify RemoteCluster State ${alias} Healthy
${stdout}= Oc On Cluster ${alias}
... oc get remoteclusters.microshift.io -o jsonpath='{.items[*].status.lastProbeTime}'
Should Not Be Empty ${stdout}
${stdout}= Oc On Cluster ${alias}
... oc get remoteclusters.microshift.io -o jsonpath='{.items[*].status.lastSuccessfulProbe}'
Should Not Be Empty ${stdout}
END

Verify All Clusters Healthy
[Documentation] Wait for all clusters to pass the MicroShift health check.
[Arguments] ${timeout}=5m ${retry}=15s
FOR ${cluster} IN @{ALL_CLUSTERS}
Wait Until Keyword Succeeds ${timeout} ${retry}
... Verify Cluster Is Healthy ${cluster}
END

Verify Full C2CC Stack
[Documentation] Comprehensive verification of all C2CC components across all clusters.
... Wraps connectivity, infrastructure, health probes, and DNS checks
... with retry logic for post-disruption convergence.
Wait Until Keyword Succeeds 10m 10s Verify Full C2CC Connectivity
FOR ${cluster} IN @{ALL_CLUSTERS}
Wait Until Keyword Succeeds 10m 10s
... Verify C2CC Infrastructure On Cluster ${cluster}
END
Wait Until Keyword Succeeds 10m 10s Verify C2CC Health Probes
Wait Until Keyword Succeeds 10m 10s Verify Full C2CC DNS
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el102-src@c2cc-disruptive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "" "" "disruptive"
c2cc_run_tests "suites/c2cc/disruptive/"
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el102-src@c2cc-dual-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "192.0.2.0/24" dual-stack
c2cc_run_tests "suites/c2cc/basic/" "192.0.2.0/24" dual-stack
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el102-src@c2cc-ipsec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ scenario_run_tests() {
configure_c2cc_hosts "c2cc_ipsec_pre_greenboot" "c2cc_ipsec_greenboot"
configure_ipsec

c2cc_run_tests "suites/c2cc-ipsec/"
c2cc_run_tests "suites/c2cc/ipsec/"
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el102-src@c2cc-ipv6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "2001:db8::/64" ipv6
c2cc_run_tests "suites/c2cc/basic/" "2001:db8::/64" ipv6
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el102-src@c2cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "192.0.2.0/24"
c2cc_run_tests "suites/c2cc/basic/" "192.0.2.0/24"
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el98-src@c2cc-disruptive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "" "" "disruptive"
c2cc_run_tests "suites/c2cc/disruptive/"
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el98-src@c2cc-dual-stack-v6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ scenario_run_tests() {
configure_c2cc_hosts
# IP_FAMILY=ipv6 so IP_CMD defaults to 'ip -6' for primary (IPv6) CIDRs.
# Dual-stack (IPv4) tests derive ip_cmd from CIDR content via IP Command For CIDR.
c2cc_run_tests "suites/c2cc/" "2001:db8::/64" ipv6
c2cc_run_tests "suites/c2cc/basic/" "2001:db8::/64" ipv6
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el98-src@c2cc-ipsec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ scenario_run_tests() {
configure_c2cc_hosts "c2cc_ipsec_pre_greenboot" "c2cc_ipsec_greenboot"
configure_ipsec

c2cc_run_tests "suites/c2cc-ipsec/"
c2cc_run_tests "suites/c2cc/ipsec/"
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el98-src@c2cc-ipv6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "2001:db8::/64" ipv6
c2cc_run_tests "suites/c2cc/basic/" "2001:db8::/64" ipv6
}
2 changes: 1 addition & 1 deletion test/scenarios-bootc/c2cc/el98-src@c2cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/c2cc/" "192.0.2.0/24"
c2cc_run_tests "suites/c2cc/basic/" "192.0.2.0/24"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ scenario_remove_vms() {
scenario_run_tests() {
# shellcheck disable=SC2119
configure_c2cc_hosts
c2cc_run_tests "suites/upgrade/upgrade-c2cc.robot"
c2cc_run_tests "suites/c2cc/upgrade/"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Documentation Verify C2CC cleanup when the feature is disabled.
... Removes the C2CC config drop-in on Cluster A, restarts MicroShift,
... and verifies all C2CC networking state has been cleaned up.

Resource ../../resources/microshift-process.resource
Resource ../../resources/kubeconfig.resource
Resource ../../resources/oc.resource
Resource ../../resources/c2cc.resource
Resource ../../../resources/microshift-process.resource
Resource ../../../resources/kubeconfig.resource
Resource ../../../resources/oc.resource
Resource ../../../resources/c2cc.resource

Suite Setup Setup
Suite Teardown Teardown
Expand Down Expand Up @@ -142,14 +142,13 @@ C2CC Controller Logged Cleanup
*** Keywords ***
Setup
[Documentation] Register clusters, then disable C2CC on Cluster A and wait for restart.
Check Required Env Variables
Register All C2CC Clusters
C2CC Suite Setup
Disable C2CC On Cluster cluster-a

Teardown
[Documentation] Re-enable C2CC on Cluster A, then close connections.
Enable C2CC On Cluster cluster-a
Teardown All Remote Clusters
C2CC Suite Teardown

Disable C2CC On Cluster
[Documentation] Move the C2CC config drop-in aside and restart MicroShift.
Expand Down
Loading