From 349ec25e3248073a2424909e59e735dfe1aa3689 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Wed, 20 May 2026 12:45:20 +0000 Subject: [PATCH 01/12] Up C2CC test VMs from 2 to 3 --- test/resources/c2cc.resource | 7 ++ .../el10/presubmits/el102-src@c2cc.sh | 38 +++++- test/suites/c2cc/cleanup.robot | 1 + test/suites/c2cc/connectivity.robot | 55 +++++++++ test/suites/c2cc/infrastructure.robot | 115 +++++++++--------- test/suites/c2cc/sanity.robot | 54 ++++---- 6 files changed, 182 insertions(+), 88 deletions(-) diff --git a/test/resources/c2cc.resource b/test/resources/c2cc.resource index badd015f7e..f5cfc21f35 100644 --- a/test/resources/c2cc.resource +++ b/test/resources/c2cc.resource @@ -22,6 +22,13 @@ ${HOST2_IP} ${EMPTY} ${HOST2_SSH_PORT} ${EMPTY} ${HOST2_API_PORT} ${EMPTY} ${KUBECONFIG_B} ${EMPTY} +${CLUSTER_C_POD_CIDR} ${EMPTY} +${CLUSTER_C_SVC_CIDR} ${EMPTY} +${CLUSTER_C_DOMAIN} ${EMPTY} +${HOST3_IP} ${EMPTY} +${HOST3_SSH_PORT} ${EMPTY} +${HOST3_API_PORT} ${EMPTY} +${KUBECONFIG_C} ${EMPTY} &{C2CC_KUBECONFIGS} &{EMPTY} &{C2CC_SSH_IDS} &{EMPTY} @{C2CC_REMOTE_ALIASES} @{EMPTY} diff --git a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh index 19705d8ce7..9d1d37cc70 100644 --- a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh +++ b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh @@ -13,10 +13,15 @@ CLUSTER_B_POD_CIDR="10.45.0.0/16" CLUSTER_B_SVC_CIDR="10.46.0.0/16" CLUSTER_B_DOMAIN="cluster-b.remote" +# Cluster C (host3): non-overlapping CIDRs +CLUSTER_C_POD_CIDR="10.47.0.0/16" +CLUSTER_C_SVC_CIDR="10.48.0.0/16" +CLUSTER_C_DOMAIN="cluster-c.remote" + wait_for_greenboot_on_hosts() { local junit_label=$1 local host - for host in host1 host2; do + for host in host1 host2 host3; do local host_ip full_host host_ip=$(get_vm_property "${host}" ip) full_host=$(full_vm_name "${host}") @@ -54,11 +59,16 @@ EOF" configure_c2cc_hosts() { local -r host1_ip=$(get_vm_property host1 ip) local -r host2_ip=$(get_vm_property host2 ip) + local -r host3_ip=$(get_vm_property host3 ip) wait_for_greenboot_on_hosts "c2cc_pre_greenboot" configure_c2cc_host host1 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" + configure_c2cc_host host1 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" configure_c2cc_host host2 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" + configure_c2cc_host host2 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" + configure_c2cc_host host3 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" + configure_c2cc_host host3 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" wait_for_greenboot_on_hosts "c2cc_greenboot" } @@ -66,6 +76,7 @@ configure_c2cc_hosts() { scenario_create_vms() { prepare_kickstart host1 kickstart-bootc.ks.template rhel102-bootc-source prepare_kickstart host2 kickstart-bootc.ks.template rhel102-bootc-source + prepare_kickstart host3 kickstart-bootc.ks.template rhel102-bootc-source # Inject host2's non-default CIDRs into its kickstart config so MicroShift # boots with the correct network from the start (no cleanup-data needed). @@ -78,15 +89,27 @@ network: serviceNetwork: - ${CLUSTER_B_SVC_CIDR} IEOF +EOF + local -r host3_ks_dir="${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host3" + cat >> "${host3_ks_dir}/post-microshift.cfg" <>/etc/microshift/config.yaml < Date: Wed, 20 May 2026 12:59:51 +0000 Subject: [PATCH 02/12] Appease Robocop --- test/suites/c2cc/connectivity.robot | 5 ++--- test/suites/c2cc/infrastructure.robot | 7 +++++++ test/suites/c2cc/sanity.robot | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/suites/c2cc/connectivity.robot b/test/suites/c2cc/connectivity.robot index 5dca55f182..3ff9b09a06 100644 --- a/test/suites/c2cc/connectivity.robot +++ b/test/suites/c2cc/connectivity.robot @@ -20,6 +20,7 @@ Test Tags c2cc *** Test Cases *** Test Cross Cluster Connectivity + [Documentation] Verify pods on all clusters can reach pods/services on all other clusters. [Template] Test Connectivity Between Clusters cluster-a cluster-b pod cluster-a cluster-b service @@ -114,12 +115,10 @@ Test Connectivity Between Clusters ELSE Fail Invalid endpoint_type: ${endpoint_type}. Must be 'pod' or 'service'. END - + ${stdout}= Curl From Cluster ${source} ${ip_dest} 8080 Should Contain ${stdout} Hello MicroShift - - Deploy Test Workloads [Documentation] Create namespace and deploy hello-microshift + curl-pod on both clusters. VAR ${assets}= ${EXECDIR}/assets/c2cc diff --git a/test/suites/c2cc/infrastructure.robot b/test/suites/c2cc/infrastructure.robot index 71eefff87b..265510a89f 100644 --- a/test/suites/c2cc/infrastructure.robot +++ b/test/suites/c2cc/infrastructure.robot @@ -16,6 +16,7 @@ Test Tags c2cc *** Test Cases *** Linux Routes Table 200 Exist + [Documentation] Verify routes to remote CIDRs exist in policy routing table 200 between all clusters. [Template] Verify Routes In Table 200 cluster-a ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} cluster-a ${CLUSTER_C_POD_CIDR} ${CLUSTER_C_SVC_CIDR} @@ -25,6 +26,7 @@ Linux Routes Table 200 Exist cluster-c ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} IP Rules For Remote CIDRs Exist + [Documentation] Verify IP rules at priority 100 direct remote CIDRs to table 200 between all clusters. [Template] Verify IP Rules For Table 200 cluster-a ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} cluster-a ${CLUSTER_C_POD_CIDR} ${CLUSTER_C_SVC_CIDR} @@ -34,12 +36,14 @@ IP Rules For Remote CIDRs Exist cluster-c ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} Service Routes Table 201 Exist + [Documentation] Verify service routes exist in table 201 on all clusters. [Template] Verify Routes In Table 201 cluster-a ${CLUSTER_A_SVC_CIDR} cluster-b ${CLUSTER_B_SVC_CIDR} cluster-c ${CLUSTER_C_SVC_CIDR} Service IP Rules Exist + [Documentation] Verify IP rules at priority 99 for service routing on all clusters. [Template] Verify Service IP Rules cluster-a ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} ${CLUSTER_A_SVC_CIDR} cluster-a ${CLUSTER_C_POD_CIDR} ${CLUSTER_C_SVC_CIDR} ${CLUSTER_A_SVC_CIDR} @@ -49,6 +53,7 @@ Service IP Rules Exist cluster-c ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} ${CLUSTER_C_SVC_CIDR} NFTables Bypass Rules Exist + [Documentation] Verify nftables masquerade bypass rules for remote CIDRs on all clusters. [Template] Verify NFTables Bypass Rules cluster-a ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} cluster-a ${CLUSTER_C_POD_CIDR} ${CLUSTER_C_SVC_CIDR} @@ -58,6 +63,7 @@ NFTables Bypass Rules Exist cluster-c ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} OVN Static Routes Exist + [Documentation] Verify OVN NB static routes tagged with microshift-c2cc on all clusters. [Template] Verify OVN Static Routes cluster-a ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} cluster-a ${CLUSTER_C_POD_CIDR} ${CLUSTER_C_SVC_CIDR} @@ -67,6 +73,7 @@ OVN Static Routes Exist cluster-c ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} Node Annotation Set + [Documentation] Verify SNAT-exclude annotation contains remote CIDRs on all clusters. [Template] Verify Node SNAT Annotation cluster-a ${CLUSTER_B_POD_CIDR} ${CLUSTER_B_SVC_CIDR} cluster-a ${CLUSTER_C_POD_CIDR} ${CLUSTER_C_SVC_CIDR} diff --git a/test/suites/c2cc/sanity.robot b/test/suites/c2cc/sanity.robot index 5adf19b500..e1b5c0be31 100644 --- a/test/suites/c2cc/sanity.robot +++ b/test/suites/c2cc/sanity.robot @@ -15,24 +15,28 @@ Test Tags c2cc *** Test Cases *** Cluster Is Running + [Documentation] Verify all clusters are healthy. [Template] Verify Cluster Is Running cluster-a cluster-b cluster-c All Pods On Cluster Are Ready + [Documentation] Verify all pods reach Ready state on all clusters. [Template] Verify All Pods Are Ready cluster-a cluster-b cluster-c Cluster Has Expected Node + [Documentation] Verify all clusters have a node. [Template] Verify Cluster Has Node cluster-a cluster-b cluster-c C2CC Controller Is Running On Cluster + [Documentation] Verify c2cc-route-manager logged startup on all clusters. [Template] Verify C2CC Controller Is Running cluster-a cluster-b From ca2fd3b36909ae4a03a5611a86d0772f9117e8d5 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Wed, 20 May 2026 13:17:55 +0000 Subject: [PATCH 03/12] Change CIDRs --- test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh index 9d1d37cc70..7884676fbb 100644 --- a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh +++ b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh @@ -14,8 +14,8 @@ CLUSTER_B_SVC_CIDR="10.46.0.0/16" CLUSTER_B_DOMAIN="cluster-b.remote" # Cluster C (host3): non-overlapping CIDRs -CLUSTER_C_POD_CIDR="10.47.0.0/16" -CLUSTER_C_SVC_CIDR="10.48.0.0/16" +CLUSTER_C_POD_CIDR="10.48.0.0/16" +CLUSTER_C_SVC_CIDR="10.49.0.0/16" CLUSTER_C_DOMAIN="cluster-c.remote" wait_for_greenboot_on_hosts() { From e9e715f38bcf03a070e3d9f7b5c9443b716570cf Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Wed, 20 May 2026 13:25:09 +0000 Subject: [PATCH 04/12] Appease the rabbit --- test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh | 2 +- test/suites/c2cc/sanity.robot | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh index 7884676fbb..c4ccb3bb65 100644 --- a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh +++ b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh @@ -37,7 +37,7 @@ configure_c2cc_host() { local host=$1 remote_ip=$2 remote_pod_cidr=$3 remote_svc_cidr=$4 remote_domain=$5 run_command_on_vm "${host}" "sudo mkdir -p /etc/microshift/config.d" - run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc.yaml > /dev/null << EOF + run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc-${remote_domain}.yaml > /dev/null << EOF clusterToCluster: remoteClusters: - nextHop: ${remote_ip} diff --git a/test/suites/c2cc/sanity.robot b/test/suites/c2cc/sanity.robot index e1b5c0be31..82043fd7bf 100644 --- a/test/suites/c2cc/sanity.robot +++ b/test/suites/c2cc/sanity.robot @@ -51,6 +51,7 @@ Setup Setup Kubeconfig Register Local Cluster cluster-a 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 kubeconfigs. From e76057aea9c97607bda7ed24ff7d52615bfd23fe Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Thu, 21 May 2026 09:28:22 +0000 Subject: [PATCH 05/12] Add host3 to el9 c2cc scenario --- .../el10/presubmits/el102-src@c2cc.sh | 2 +- .../el9/presubmits/el98-src@c2cc.sh | 42 +++++++++++++++++-- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh index c4ccb3bb65..10f6f136fb 100644 --- a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh +++ b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh @@ -78,7 +78,7 @@ scenario_create_vms() { prepare_kickstart host2 kickstart-bootc.ks.template rhel102-bootc-source prepare_kickstart host3 kickstart-bootc.ks.template rhel102-bootc-source - # Inject host2's non-default CIDRs into its kickstart config so MicroShift + # Inject host2's and host3's non-default CIDRs into its kickstart config so MicroShift # boots with the correct network from the start (no cleanup-data needed). local -r host2_ks_dir="${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host2" cat >> "${host2_ks_dir}/post-microshift.cfg" < /dev/null << EOF + run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc-${remote_domain}.yaml > /dev/null << EOF clusterToCluster: remoteClusters: - nextHop: ${remote_ip} @@ -54,11 +59,16 @@ EOF" configure_c2cc_hosts() { local -r host1_ip=$(get_vm_property host1 ip) local -r host2_ip=$(get_vm_property host2 ip) + local -r host3_ip=$(get_vm_property host3 ip) wait_for_greenboot_on_hosts "c2cc_pre_greenboot" configure_c2cc_host host1 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" + configure_c2cc_host host1 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" configure_c2cc_host host2 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" + configure_c2cc_host host2 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" + configure_c2cc_host host3 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" + configure_c2cc_host host3 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" wait_for_greenboot_on_hosts "c2cc_greenboot" } @@ -66,8 +76,9 @@ configure_c2cc_hosts() { scenario_create_vms() { prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source prepare_kickstart host2 kickstart-bootc.ks.template rhel98-bootc-source + prepare_kickstart host3 kickstart-bootc.ks.template rhel98-bootc-source - # Inject host2's non-default CIDRs into its kickstart config so MicroShift + # Inject host2's and host3's non-default CIDRs into its kickstart config so MicroShift # boots with the correct network from the start (no cleanup-data needed). local -r host2_ks_dir="${SCENARIO_INFO_DIR}/${SCENARIO}/vms/host2" cat >> "${host2_ks_dir}/post-microshift.cfg" <> "${host3_ks_dir}/post-microshift.cfg" <>/etc/microshift/config.yaml < Date: Thu, 21 May 2026 09:41:43 +0000 Subject: [PATCH 06/12] Fix overwriting configs --- .../el10/presubmits/el102-src@c2cc.sh | 60 +++++++++++++------ .../el9/presubmits/el98-src@c2cc.sh | 60 +++++++++++++------ 2 files changed, 82 insertions(+), 38 deletions(-) diff --git a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh index 10f6f136fb..15c3a1c3e9 100644 --- a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh +++ b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh @@ -34,25 +34,42 @@ wait_for_greenboot_on_hosts() { } configure_c2cc_host() { - local host=$1 remote_ip=$2 remote_pod_cidr=$3 remote_svc_cidr=$4 remote_domain=$5 + local host=$1 + shift + # Remaining args are sets of 4: remote_ip remote_pod_cidr remote_svc_cidr remote_domain (repeat) run_command_on_vm "${host}" "sudo mkdir -p /etc/microshift/config.d" - run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc-${remote_domain}.yaml > /dev/null << EOF -clusterToCluster: - remoteClusters: - - nextHop: ${remote_ip} - clusterNetwork: - - ${remote_pod_cidr} - serviceNetwork: - - ${remote_svc_cidr} - domain: ${remote_domain} + + # Build the YAML config with all remote clusters + local yaml_content="clusterToCluster:\n remoteClusters:" + local firewall_cidrs=() + + while [ $# -gt 0 ]; do + local remote_ip=$1 + local remote_pod_cidr=$2 + local remote_svc_cidr=$3 + local remote_domain=$4 + shift 4 + + yaml_content+="\n - nextHop: ${remote_ip}" + yaml_content+="\n clusterNetwork:" + yaml_content+="\n - ${remote_pod_cidr}" + yaml_content+="\n serviceNetwork:" + yaml_content+="\n - ${remote_svc_cidr}" + yaml_content+="\n domain: ${remote_domain}" + + firewall_cidrs+=("${remote_pod_cidr}" "${remote_svc_cidr}") + done + + run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc.yaml > /dev/null << 'EOF' +${yaml_content} EOF" configure_vm_firewall "${host}" - run_command_on_vm "${host}" "sudo firewall-cmd --permanent --zone=trusted --add-source=${remote_pod_cidr}" - run_command_on_vm "${host}" "sudo firewall-cmd --permanent --zone=trusted --add-source=${remote_svc_cidr}" + for cidr in "${firewall_cidrs[@]}"; do + run_command_on_vm "${host}" "sudo firewall-cmd --permanent --zone=trusted --add-source=${cidr}" + done run_command_on_vm "${host}" "sudo firewall-cmd --reload" - run_command_on_vm "${host}" "sudo systemctl restart microshift" } @@ -63,12 +80,17 @@ configure_c2cc_hosts() { wait_for_greenboot_on_hosts "c2cc_pre_greenboot" - configure_c2cc_host host1 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" - configure_c2cc_host host1 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" - configure_c2cc_host host2 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" - configure_c2cc_host host2 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" - configure_c2cc_host host3 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" - configure_c2cc_host host3 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" + configure_c2cc_host host1 \ + "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" \ + "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" + + configure_c2cc_host host2 \ + "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" \ + "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" + + configure_c2cc_host host3 \ + "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" \ + "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" wait_for_greenboot_on_hosts "c2cc_greenboot" } diff --git a/test/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh b/test/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh index 0776e69bec..ef3c0bf295 100644 --- a/test/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh +++ b/test/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh @@ -34,25 +34,42 @@ wait_for_greenboot_on_hosts() { } configure_c2cc_host() { - local host=$1 remote_ip=$2 remote_pod_cidr=$3 remote_svc_cidr=$4 remote_domain=$5 + local host=$1 + shift + # Remaining args are sets of 4: remote_ip remote_pod_cidr remote_svc_cidr remote_domain (repeat) run_command_on_vm "${host}" "sudo mkdir -p /etc/microshift/config.d" - run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc-${remote_domain}.yaml > /dev/null << EOF -clusterToCluster: - remoteClusters: - - nextHop: ${remote_ip} - clusterNetwork: - - ${remote_pod_cidr} - serviceNetwork: - - ${remote_svc_cidr} - domain: ${remote_domain} + + # Build the YAML config with all remote clusters + local yaml_content="clusterToCluster:\n remoteClusters:" + local firewall_cidrs=() + + while [ $# -gt 0 ]; do + local remote_ip=$1 + local remote_pod_cidr=$2 + local remote_svc_cidr=$3 + local remote_domain=$4 + shift 4 + + yaml_content+="\n - nextHop: ${remote_ip}" + yaml_content+="\n clusterNetwork:" + yaml_content+="\n - ${remote_pod_cidr}" + yaml_content+="\n serviceNetwork:" + yaml_content+="\n - ${remote_svc_cidr}" + yaml_content+="\n domain: ${remote_domain}" + + firewall_cidrs+=("${remote_pod_cidr}" "${remote_svc_cidr}") + done + + run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc.yaml > /dev/null << 'EOF' +${yaml_content} EOF" configure_vm_firewall "${host}" - run_command_on_vm "${host}" "sudo firewall-cmd --permanent --zone=trusted --add-source=${remote_pod_cidr}" - run_command_on_vm "${host}" "sudo firewall-cmd --permanent --zone=trusted --add-source=${remote_svc_cidr}" + for cidr in "${firewall_cidrs[@]}"; do + run_command_on_vm "${host}" "sudo firewall-cmd --permanent --zone=trusted --add-source=${cidr}" + done run_command_on_vm "${host}" "sudo firewall-cmd --reload" - run_command_on_vm "${host}" "sudo systemctl restart microshift" } @@ -63,12 +80,17 @@ configure_c2cc_hosts() { wait_for_greenboot_on_hosts "c2cc_pre_greenboot" - configure_c2cc_host host1 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" - configure_c2cc_host host1 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" - configure_c2cc_host host2 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" - configure_c2cc_host host2 "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" - configure_c2cc_host host3 "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" - configure_c2cc_host host3 "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" + configure_c2cc_host host1 \ + "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" \ + "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" + + configure_c2cc_host host2 \ + "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" \ + "${host3_ip}" "${CLUSTER_C_POD_CIDR}" "${CLUSTER_C_SVC_CIDR}" "${CLUSTER_C_DOMAIN}" + + configure_c2cc_host host3 \ + "${host1_ip}" "${CLUSTER_A_POD_CIDR}" "${CLUSTER_A_SVC_CIDR}" "${CLUSTER_A_DOMAIN}" \ + "${host2_ip}" "${CLUSTER_B_POD_CIDR}" "${CLUSTER_B_SVC_CIDR}" "${CLUSTER_B_DOMAIN}" wait_for_greenboot_on_hosts "c2cc_greenboot" } From 7f463739664323ecd7814104ec85a496ec66a9f9 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Thu, 21 May 2026 09:56:32 +0000 Subject: [PATCH 07/12] Use 3 VMs in cleanup.robot --- test/suites/c2cc/cleanup.robot | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/test/suites/c2cc/cleanup.robot b/test/suites/c2cc/cleanup.robot index d7117eee61..7ab763c763 100644 --- a/test/suites/c2cc/cleanup.robot +++ b/test/suites/c2cc/cleanup.robot @@ -24,14 +24,24 @@ ${C2CC_CONFIG_PATH} /etc/microshift/config.d/50-c2cc.yaml No Linux Routes In Table 200 After Disable [Documentation] Routes to remote CIDRs in table 200 should be gone. ${stdout}= Command On Cluster cluster-a ip route show table 200 - Should Not Contain ${stdout} ${CLUSTER_B_POD_CIDR} - Should Not Contain ${stdout} ${CLUSTER_B_SVC_CIDR} + FOR ${cidr} IN + ... ${CLUSTER_B_POD_CIDR} + ... ${CLUSTER_B_SVC_CIDR} + ... ${CLUSTER_C_POD_CIDR} + ... ${CLUSTER_C_SVC_CIDR} + Should Not Contain ${stdout} ${cidr} + END No IP Rules For Table 200 After Disable [Documentation] IP rules directing to table 200 should be gone. ${stdout}= Command On Cluster cluster-a ip rule show - Should Not Contain ${stdout} to ${CLUSTER_B_POD_CIDR} lookup 200 - Should Not Contain ${stdout} to ${CLUSTER_B_SVC_CIDR} lookup 200 + FOR ${cidr} IN + ... ${CLUSTER_B_POD_CIDR} + ... ${CLUSTER_B_SVC_CIDR} + ... ${CLUSTER_C_POD_CIDR} + ... ${CLUSTER_C_SVC_CIDR} + Should Not Contain ${stdout} to ${cidr} lookup 200 + END No Service Routes In Table 201 After Disable [Documentation] Service routes in table 201 should be gone. @@ -41,8 +51,13 @@ No Service Routes In Table 201 After Disable No Service IP Rules After Disable [Documentation] Service IP rules for table 201 should be gone. ${stdout}= Command On Cluster cluster-a ip rule show - Should Not Contain ${stdout} from ${CLUSTER_B_POD_CIDR} to ${CLUSTER_A_SVC_CIDR} lookup 201 - Should Not Contain ${stdout} from ${CLUSTER_B_SVC_CIDR} to ${CLUSTER_A_SVC_CIDR} lookup 201 + FOR ${cidr} IN + ... ${CLUSTER_B_POD_CIDR} + ... ${CLUSTER_B_SVC_CIDR} + ... ${CLUSTER_C_POD_CIDR} + ... ${CLUSTER_C_SVC_CIDR} + Should Not Contain ${stdout} from ${cidr} to ${CLUSTER_A_SVC_CIDR} lookup 201 + END No NFTables Bypass Rules After Disable [Documentation] C2CC nftables masquerade bypass rules should be gone. From ed2bb769ea23181c33424405b21ac0e05b70d658 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Thu, 21 May 2026 12:52:21 +0000 Subject: [PATCH 08/12] Fix variable expansion --- .../el10/presubmits/el102-src@c2cc.sh | 17 +++++++++-------- .../el9/presubmits/el98-src@c2cc.sh | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh index 15c3a1c3e9..e80fdf5c9a 100644 --- a/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh +++ b/test/scenarios-bootc/el10/presubmits/el102-src@c2cc.sh @@ -41,7 +41,8 @@ configure_c2cc_host() { run_command_on_vm "${host}" "sudo mkdir -p /etc/microshift/config.d" # Build the YAML config with all remote clusters - local yaml_content="clusterToCluster:\n remoteClusters:" + local yaml_content + yaml_content="clusterToCluster:"$'\n'" remoteClusters:" local firewall_cidrs=() while [ $# -gt 0 ]; do @@ -51,17 +52,17 @@ configure_c2cc_host() { local remote_domain=$4 shift 4 - yaml_content+="\n - nextHop: ${remote_ip}" - yaml_content+="\n clusterNetwork:" - yaml_content+="\n - ${remote_pod_cidr}" - yaml_content+="\n serviceNetwork:" - yaml_content+="\n - ${remote_svc_cidr}" - yaml_content+="\n domain: ${remote_domain}" + yaml_content+=$'\n'" - nextHop: ${remote_ip}" + yaml_content+=$'\n'" clusterNetwork:" + yaml_content+=$'\n'" - ${remote_pod_cidr}" + yaml_content+=$'\n'" serviceNetwork:" + yaml_content+=$'\n'" - ${remote_svc_cidr}" + yaml_content+=$'\n'" domain: ${remote_domain}" firewall_cidrs+=("${remote_pod_cidr}" "${remote_svc_cidr}") done - run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc.yaml > /dev/null << 'EOF' + run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc.yaml > /dev/null < /dev/null << 'EOF' + run_command_on_vm "${host}" "sudo tee /etc/microshift/config.d/50-c2cc.yaml > /dev/null < Date: Mon, 25 May 2026 09:47:10 +0000 Subject: [PATCH 09/12] Template IP preservation test case --- test/suites/c2cc/connectivity.robot | 92 +++++++++++------------------ 1 file changed, 36 insertions(+), 56 deletions(-) diff --git a/test/suites/c2cc/connectivity.robot b/test/suites/c2cc/connectivity.robot index 3ff9b09a06..cf7870bb51 100644 --- a/test/suites/c2cc/connectivity.robot +++ b/test/suites/c2cc/connectivity.robot @@ -15,7 +15,7 @@ Test Tags c2cc *** Variables *** -&{NAMESPACES} cluster-a=${EMPTY} cluster-b=${EMPTY} +&{NAMESPACES} cluster-a=${EMPTY} cluster-b=${EMPTY} cluster-c=${EMPTY} *** Test Cases *** @@ -34,62 +34,27 @@ Test Cross Cluster Connectivity cluster-c cluster-a service cluster-c cluster-b pod cluster-c cluster-b service -Pod To Pod From Cluster A To Cluster B - [Documentation] Verify pod on Cluster A can reach pod IP on Cluster B. - ${pod_ip_b}= Get Hello Pod IP cluster-b - ${stdout}= Curl From Cluster cluster-a ${pod_ip_b} 8080 - Should Contain ${stdout} Hello from - -Pod To Pod From Cluster B To Cluster A - [Documentation] Verify pod on Cluster B can reach pod IP on Cluster A. - ${pod_ip_a}= Get Hello Pod IP cluster-a - ${stdout}= Curl From Cluster cluster-b ${pod_ip_a} 8080 - Should Contain ${stdout} Hello from - -Pod To Service From Cluster A To Cluster B - [Documentation] Verify pod on Cluster A can reach service ClusterIP on Cluster B. - ${svc_ip_b}= Get Hello Service IP cluster-b - ${stdout}= Curl From Cluster cluster-a ${svc_ip_b} 8080 - Should Contain ${stdout} Hello from - -Pod To Service From Cluster B To Cluster A - [Documentation] Verify pod on Cluster B can reach service ClusterIP on Cluster A. - ${svc_ip_a}= Get Hello Service IP cluster-a - ${stdout}= Curl From Cluster cluster-b ${svc_ip_a} 8080 - Should Contain ${stdout} Hello from - -Source IP Preserved Pod To Pod From Cluster A To Cluster B - [Documentation] Verify cross-cluster pod-to-pod traffic preserves the source pod IP (no SNAT). - ${curl_pod_ip}= Get Curl Pod IP cluster-a - ${pod_ip_b}= Get Hello Pod IP cluster-b - ${stdout}= Curl From Cluster cluster-a ${pod_ip_b} 8080 - Should Contain ${stdout} source: ${curl_pod_ip} - -Source IP Preserved Pod To Pod From Cluster B To Cluster A - [Documentation] Verify cross-cluster pod-to-pod traffic preserves the source pod IP (no SNAT). - ${curl_pod_ip}= Get Curl Pod IP cluster-b - ${pod_ip_a}= Get Hello Pod IP cluster-a - ${stdout}= Curl From Cluster cluster-b ${pod_ip_a} 8080 - Should Contain ${stdout} source: ${curl_pod_ip} - -Source IP Preserved Pod To Service From Cluster A To Cluster B - [Documentation] Verify cross-cluster pod-to-service traffic preserves the source pod IP (no SNAT). - ${curl_pod_ip}= Get Curl Pod IP cluster-a - ${svc_ip_b}= Get Hello Service IP cluster-b - ${stdout}= Curl From Cluster cluster-a ${svc_ip_b} 8080 - Should Contain ${stdout} source: ${curl_pod_ip} -Source IP Preserved Pod To Service From Cluster B To Cluster A - [Documentation] Verify cross-cluster pod-to-service traffic preserves the source pod IP (no SNAT). - ${curl_pod_ip}= Get Curl Pod IP cluster-b - ${svc_ip_a}= Get Hello Service IP cluster-a - ${stdout}= Curl From Cluster cluster-b ${svc_ip_a} 8080 - Should Contain ${stdout} source: ${curl_pod_ip} +Test Cross Cluster Source IP Preservation + [Documentation] Verify cross cluster traffic preserves source pod IP (no SNAT). + [Template] Test Source IP Preserved Between Clusters + cluster-a cluster-b pod + cluster-a cluster-b service + cluster-a cluster-c pod + cluster-a cluster-c service + cluster-b cluster-a pod + cluster-b cluster-a service + cluster-b cluster-c pod + cluster-b cluster-c service + cluster-c cluster-a pod + cluster-c cluster-a service + cluster-c cluster-b pod + cluster-c cluster-b service *** Keywords *** Setup - [Documentation] Set up clusters and deploy test workloads on both. + [Documentation] Set up clusters and deploy test workloads on all. Check Required Env Variables Login MicroShift Host Setup Kubeconfig @@ -117,10 +82,25 @@ Test Connectivity Between Clusters END ${stdout}= Curl From Cluster ${source} ${ip_dest} 8080 - Should Contain ${stdout} Hello MicroShift + Should Contain ${stdout} Hello from + +Test 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} + ${curl_pod_ip}= Get Curl Pod IP ${source} + IF '${endpoint_type}' == 'pod' + ${ip_dest}= Get Hello Pod IP ${destination} + ELSE IF '${endpoint_type}' == 'service' + ${ip_dest}= Get Hello Service IP ${destination} + ELSE + Fail Invalid endpoint_type: ${endpoint_type}. Must be 'pod' or 'service'. + END + + ${stdout}= Curl From Cluster ${source} ${ip_dest} 8080 + Should Contain ${stdout} source: ${curl_pod_ip} Deploy Test Workloads - [Documentation] Create namespace and deploy hello-microshift + curl-pod on both clusters. + [Documentation] Create namespace and deploy hello-microshift + curl-pod on all clusters. VAR ${assets}= ${EXECDIR}/assets/c2cc FOR ${alias} IN cluster-a cluster-b cluster-c Oc On Cluster ${alias} oc create namespace ${NAMESPACE} @@ -130,14 +110,14 @@ Deploy Test Workloads Wait For Test Pods Wait For Test Pods - [Documentation] Wait for all test pods to be Ready on both clusters. + [Documentation] Wait for all test pods to be Ready on all clusters. FOR ${alias} IN cluster-a cluster-b cluster-c Oc On Cluster ${alias} ... oc wait pod/hello-microshift pod/curl-pod -n ${NAMESPACE} --for=condition=Ready --timeout=120s END Cleanup Test Workloads - [Documentation] Delete test namespace on both clusters. Ignores errors. + [Documentation] Delete test namespace on all clusters. Ignores errors. FOR ${alias} IN cluster-a cluster-b cluster-c Run Keyword And Ignore Error ... Oc On Cluster ${alias} oc delete namespace ${NAMESPACE} --timeout=60s From 909b9594f0b1c6fab84b0df9f44cfb109de98e30 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Mon, 25 May 2026 11:47:20 +0000 Subject: [PATCH 10/12] Remove duplicate keywords, fix c2cc.resource to account for 3 VMs --- test/resources/c2cc.resource | 16 ++++++++-------- test/suites/c2cc/connectivity.robot | 26 +------------------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/test/resources/c2cc.resource b/test/resources/c2cc.resource index f5cfc21f35..0cc408bc8e 100644 --- a/test/resources/c2cc.resource +++ b/test/resources/c2cc.resource @@ -256,9 +256,9 @@ Verify Corefile Does Not Contain C2CC Server Block Should Not Contain ${stdout} ${domain}:5353 Deploy Test Workloads - [Documentation] Create namespace and deploy hello-microshift + curl-pod on both clusters. + [Documentation] Create namespace and deploy hello-microshift + curl-pod on all clusters. VAR ${assets}= ${EXECDIR}/assets/c2cc - FOR ${alias} IN cluster-a cluster-b + FOR ${alias} IN cluster-a cluster-b cluster-c ${ns}= Create Unique Namespace On Cluster ${alias} Set To Dictionary ${NAMESPACES} ${alias} ${ns} Oc On Cluster ${alias} oc apply -n ${ns} -f ${assets}/hello-microshift.yaml @@ -268,17 +268,17 @@ Deploy Test Workloads Wait For Service Endpoints Wait For Test Pods - [Documentation] Wait for all test pods to be Ready on both clusters. - FOR ${alias} IN cluster-a cluster-b + [Documentation] Wait for all test pods to be Ready on all clusters. + FOR ${alias} IN cluster-a cluster-b cluster-c Oc On Cluster ... ${alias} ... oc wait pod/hello-microshift pod/curl-pod -n ${NAMESPACES}[${alias}] --for=condition=Ready --timeout=120s END Wait For Service Endpoints - [Documentation] Wait for hello-microshift service to have endpoints on both clusters. + [Documentation] Wait for hello-microshift service to have endpoints on all clusters. ... Ensures OVN-K has synced the EndpointSlice and programmed the OVN load balancer. - FOR ${alias} IN cluster-a cluster-b + FOR ${alias} IN cluster-a cluster-b cluster-c Wait Until Keyword Succeeds 120s 5s ... Service Endpoints Should Exist ${alias} ${NAMESPACES}[${alias}] END @@ -291,7 +291,7 @@ Service Endpoints Should Exist Should Not Be Empty ${stdout} Cleanup Test Workloads - [Documentation] Delete test namespace on both clusters. Ignores errors. - FOR ${alias} IN cluster-a cluster-b + [Documentation] Delete test namespace on all clusters. Ignores errors. + FOR ${alias} IN cluster-a cluster-b cluster-c Oc On Cluster ${alias} oc delete namespace ${NAMESPACES}[${alias}] --timeout=60s END diff --git a/test/suites/c2cc/connectivity.robot b/test/suites/c2cc/connectivity.robot index cf7870bb51..e645045243 100644 --- a/test/suites/c2cc/connectivity.robot +++ b/test/suites/c2cc/connectivity.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Cross-cluster connectivity tests for C2CC. -... Deploys test workloads on both clusters and verifies pod-to-pod +... Deploys test workloads on all clusters and verifies pod-to-pod ... and pod-to-service communication in both directions. Resource ../../resources/microshift-process.resource @@ -99,30 +99,6 @@ Test Source IP Preserved Between Clusters ${stdout}= Curl From Cluster ${source} ${ip_dest} 8080 Should Contain ${stdout} source: ${curl_pod_ip} -Deploy Test Workloads - [Documentation] Create namespace and deploy hello-microshift + curl-pod on all clusters. - VAR ${assets}= ${EXECDIR}/assets/c2cc - FOR ${alias} IN cluster-a cluster-b cluster-c - Oc On Cluster ${alias} oc create namespace ${NAMESPACE} - Oc On Cluster ${alias} oc apply -n ${NAMESPACE} -f ${assets}/hello-microshift.yaml - Oc On Cluster ${alias} oc apply -n ${NAMESPACE} -f ${assets}/curl-pod.yaml - END - Wait For Test Pods - -Wait For Test Pods - [Documentation] Wait for all test pods to be Ready on all clusters. - FOR ${alias} IN cluster-a cluster-b cluster-c - Oc On Cluster ${alias} - ... oc wait pod/hello-microshift pod/curl-pod -n ${NAMESPACE} --for=condition=Ready --timeout=120s - END - -Cleanup Test Workloads - [Documentation] Delete test namespace on all clusters. Ignores errors. - FOR ${alias} IN cluster-a cluster-b cluster-c - Run Keyword And Ignore Error - ... Oc On Cluster ${alias} oc delete namespace ${NAMESPACE} --timeout=60s - END - Get Hello Pod IP [Documentation] Get the pod IP of hello-microshift on the given cluster. [Arguments] ${alias} From b59b7c64f5c7bc6b5fc114f1691b56b9662a023b Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Mon, 25 May 2026 13:48:23 +0000 Subject: [PATCH 11/12] Edit c2cc DNS suite to use 3 VMs --- test/suites/c2cc/dns.robot | 71 +++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/test/suites/c2cc/dns.robot b/test/suites/c2cc/dns.robot index a9a2733c4a..356847bbae 100644 --- a/test/suites/c2cc/dns.robot +++ b/test/suites/c2cc/dns.robot @@ -16,49 +16,51 @@ Test Tags c2cc *** Variables *** -&{NAMESPACES} cluster-a=${EMPTY} cluster-b=${EMPTY} +&{NAMESPACES} cluster-a=${EMPTY} cluster-b=${EMPTY} cluster-c=${EMPTY} +&{DOMAIN_MAP} cluster-a=${CLUSTER_A_DOMAIN} cluster-b=${CLUSTER_B_DOMAIN} cluster-c=${CLUSTER_C_DOMAIN} *** Test Cases *** -Corefile Contains C2CC Server Block On Cluster A - [Documentation] Verify Cluster A's Corefile has a server block for Cluster B's domain. - Verify Corefile Contains C2CC Server Block cluster-a ${CLUSTER_B_DOMAIN} - -Corefile Contains C2CC Server Block On Cluster B - [Documentation] Verify Cluster B's Corefile has a server block for Cluster A's domain. - Verify Corefile Contains C2CC Server Block cluster-b ${CLUSTER_A_DOMAIN} - -Resolve Remote Service DNS From Cluster A - [Documentation] Verify pod on Cluster A can resolve a service on Cluster B via DNS. - DNS Resolve From Cluster cluster-a - ... hello-microshift.${NAMESPACES}[cluster-b].svc.${CLUSTER_B_DOMAIN} - -Resolve Remote Service DNS From Cluster B - [Documentation] Verify pod on Cluster B can resolve a service on Cluster A via DNS. - DNS Resolve From Cluster cluster-b - ... hello-microshift.${NAMESPACES}[cluster-a].svc.${CLUSTER_A_DOMAIN} - -Curl Remote Service Via DNS From Cluster A - [Documentation] Verify pod on Cluster A can reach a service on Cluster B using the remote DNS name. - ${stdout}= Curl DNS From Cluster cluster-a - ... hello-microshift.${NAMESPACES}[cluster-b].svc.${CLUSTER_B_DOMAIN} 8080 - Should Contain ${stdout} Hello from - -Curl Remote Service Via DNS From Cluster B - [Documentation] Verify pod on Cluster B can reach a service on Cluster A using the remote DNS name. - ${stdout}= Curl DNS From Cluster cluster-b - ... hello-microshift.${NAMESPACES}[cluster-a].svc.${CLUSTER_A_DOMAIN} 8080 - Should Contain ${stdout} Hello from +Test Corefile Contains C2CC Server Block + [Documentation] Verify every cluster's Corefile has a server block for every other cluster domain. + [Template] Verify Corefile Contains C2CC Server Block + cluster-a ${CLUSTER_B_DOMAIN} + cluster-a ${CLUSTER_C_DOMAIN} + cluster-b ${CLUSTER_A_DOMAIN} + cluster-b ${CLUSTER_C_DOMAIN} + cluster-c ${CLUSTER_A_DOMAIN} + cluster-c ${CLUSTER_B_DOMAIN} + +Test Resolve Remote Service DNS + [Documentation] Verify pods can resolve a service on all clusters via DNS. + [Template] DNS Resolve From Cluster + cluster-a hello-microshift.${NAMESPACES}[cluster-b].svc.${DOMAIN_MAP}[cluster-b] + cluster-a hello-microshift.${NAMESPACES}[cluster-c].svc.${DOMAIN_MAP}[cluster-c] + cluster-b hello-microshift.${NAMESPACES}[cluster-a].svc.${DOMAIN_MAP}[cluster-a] + cluster-b hello-microshift.${NAMESPACES}[cluster-c].svc.${DOMAIN_MAP}[cluster-c] + cluster-c hello-microshift.${NAMESPACES}[cluster-a].svc.${DOMAIN_MAP}[cluster-a] + cluster-c hello-microshift.${NAMESPACES}[cluster-b].svc.${DOMAIN_MAP}[cluster-b] + +Test Curl Remote Service Via DNS + [Documentation] Verify pod on a cluster can reach a service on all clusters using the remote DNS name. + [Template] Curl Remote Service Via DNS + cluster-a cluster-b + cluster-a cluster-c + cluster-b cluster-a + cluster-b cluster-c + cluster-c cluster-a + cluster-c cluster-b *** Keywords *** Setup - [Documentation] Set up clusters and deploy test workloads on both. + [Documentation] Set up clusters and deploy test workloads on all. Check Required Env Variables Login MicroShift Host Setup Kubeconfig Register Local Cluster cluster-a Register Remote Cluster cluster-b ${HOST2_IP} ${HOST2_SSH_PORT} ${KUBECONFIG_B} + Register Remote Cluster cluster-c ${HOST3_IP} ${HOST3_SSH_PORT} ${KUBECONFIG_C} Deploy Test Workloads Teardown @@ -68,6 +70,13 @@ Teardown Remove Kubeconfig Logout MicroShift Host +Curl 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} + ... hello-microshift.${NAMESPACES}[${destination}].svc.${DOMAIN_MAP}[${destination}] 8080 + Should Contain ${stdout} Hello from + DNS Resolve From Cluster [Documentation] Resolve a DNS name from curl-pod on the given cluster. Retries for up to 60s. [Arguments] ${alias} ${fqdn} From 7a47af41bac192094a220228f0b3653e56e79f3a Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Mon, 25 May 2026 13:49:31 +0000 Subject: [PATCH 12/12] Appease Robocop --- test/suites/c2cc/dns.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/suites/c2cc/dns.robot b/test/suites/c2cc/dns.robot index 356847bbae..21438b79a4 100644 --- a/test/suites/c2cc/dns.robot +++ b/test/suites/c2cc/dns.robot @@ -17,7 +17,7 @@ Test Tags c2cc *** Variables *** &{NAMESPACES} cluster-a=${EMPTY} cluster-b=${EMPTY} cluster-c=${EMPTY} -&{DOMAIN_MAP} cluster-a=${CLUSTER_A_DOMAIN} cluster-b=${CLUSTER_B_DOMAIN} cluster-c=${CLUSTER_C_DOMAIN} +&{DOMAIN_MAP} cluster-a=${CLUSTER_A_DOMAIN} cluster-b=${CLUSTER_B_DOMAIN} cluster-c=${CLUSTER_C_DOMAIN} *** Test Cases ***