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
10 changes: 1 addition & 9 deletions test/scenarios-bootc/presubmits/el96-src@dual-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,5 @@ scenario_remove_vms() {
}

scenario_run_tests() {
local -r vmname=$(full_vm_name host1)
# Valid IP addresses are the first two entries returned by manage-vm script.
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -2 | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
suites/ipv6/dualstack.robot
run_tests host1 suites/ipv6/dualstack.robot
}
11 changes: 1 addition & 10 deletions test/scenarios-bootc/releases/el96-lrel@dual-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,5 @@ scenario_remove_vms() {

scenario_run_tests() {
exit_if_image_not_found "${start_image}"

local -r vmname=$(full_vm_name host1)
# Valid IP addresses are the first two entries returned by manage-vm script.
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -2 | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
suites/ipv6/dualstack.robot
run_tests host1 suites/ipv6/dualstack.robot
}
9 changes: 1 addition & 8 deletions test/scenarios/presubmits/el96-src@dual-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,5 @@ scenario_remove_vms() {
}

scenario_run_tests() {
local -r vmname=$(full_vm_name host1)
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
suites/ipv6/dualstack.robot
run_tests host1 suites/ipv6/dualstack.robot
}
10 changes: 1 addition & 9 deletions test/scenarios/releases/el96-lrel@dual-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,5 @@ scenario_remove_vms() {

scenario_run_tests() {
exit_if_commit_not_found "${start_image}"

local -r vmname=$(full_vm_name host1)
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
suites/ipv6/dualstack.robot
run_tests host1 suites/ipv6/dualstack.robot
}
84 changes: 49 additions & 35 deletions test/suites/ipv6/dualstack.robot
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Test Tags ipv6 network


*** Variables ***
${USHIFT_HOST_IP1} ${EMPTY}
${USHIFT_HOST_IP2} ${EMPTY}
${HOSTNAME} hello-microshift.dualstack.cluster.local
${USHIFT_HOST} ${EMPTY}
${HOSTNAME} hello-microshift.dualstack.cluster.local


*** Test Cases ***
Expand All @@ -29,19 +28,22 @@ Verify New Pod Works With IPv6
... Expose Hello MicroShift Service Via Route IPv6
... Restart Router

${pod_ip}= Oc Get JsonPath pod ${NAMESPACE} hello-microshift .status.podIPs[0].ip
Must Not Be Ipv6 ${pod_ip}
${pod_ip}= Oc Get JsonPath pod ${NAMESPACE} hello-microshift .status.podIPs[1].ip
Must Be Ipv6 ${pod_ip}
${service_ip}= Oc Get JsonPath svc ${NAMESPACE} hello-microshift .spec.clusterIP
Must Be Ipv6 ${service_ip}

Wait Until Keyword Succeeds 10x 6s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IP1}
${ip_families}= Oc Get JsonPath svc ${NAMESPACE} hello-microshift .spec.ipFamilies
Should Contain ${ip_families} IPv6
${addr_type}= Oc Get JsonPath
... endpointslice
... ${NAMESPACE}
... -l kubernetes.io/service-name=hello-microshift
... .items[0].addressType
Should Be Equal ${addr_type} IPv6

Wait Until Keyword Succeeds 20x 10s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST}
... ushift_port=${HTTP_PORT}
... hostname=${HOSTNAME}
Wait Until Keyword Succeeds 10x 6s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IP2}
${USHIFT_HOST_IPV6}= Get MicroShift Node IPv6
Wait Until Keyword Succeeds 20x 10s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IPV6}
... ushift_port=${HTTP_PORT}
... hostname=${HOSTNAME}

Expand All @@ -60,19 +62,22 @@ Verify New Pod Works With IPv4
... Expose Hello MicroShift Service Via Route IPv4
... Restart Router

${pod_ip}= Oc Get JsonPath pod ${NAMESPACE} hello-microshift .status.podIPs[0].ip
Must Not Be Ipv6 ${pod_ip}
${pod_ip}= Oc Get JsonPath pod ${NAMESPACE} hello-microshift .status.podIPs[1].ip
Must Be Ipv6 ${pod_ip}
${service_ip}= Oc Get JsonPath svc ${NAMESPACE} hello-microshift .spec.clusterIP
Must Not Be Ipv6 ${service_ip}

Wait Until Keyword Succeeds 10x 6s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IP1}
${ip_families}= Oc Get JsonPath svc ${NAMESPACE} hello-microshift .spec.ipFamilies
Should Contain ${ip_families} IPv4
${addr_type}= Oc Get JsonPath
... endpointslice
... ${NAMESPACE}
... -l kubernetes.io/service-name=hello-microshift
... .items[0].addressType
Should Be Equal ${addr_type} IPv4

Wait Until Keyword Succeeds 20x 10s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST}
... ushift_port=${HTTP_PORT}
... hostname=${HOSTNAME}
Wait Until Keyword Succeeds 10x 6s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IP2}
${USHIFT_HOST_IPV6}= Get MicroShift Node IPv6
Wait Until Keyword Succeeds 20x 10s
... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IPV6}
... ushift_port=${HTTP_PORT}
... hostname=${HOSTNAME}

Expand All @@ -89,7 +94,7 @@ Verify Host Network Pods Get Dual Stack IP Addresses
... Migrate To Dual Stack

# Wait a bit, as this is updated by kubelet and may not be immediate.
Wait Until Keyword Succeeds 10x 6s
Wait Until Keyword Succeeds 20x 6s
... Host Network Pods Should Have Dual Stack IPs

[Teardown] Run Keywords
Expand All @@ -100,11 +105,15 @@ Verify Host Network Pods Get Dual Stack IP Addresses
*** Keywords ***
Setup
[Documentation] Test suite setup
Initialize Global Variables
Login MicroShift Host
Setup Suite With Namespace
Wait Until Greenboot Health Check Exited

Get MicroShift Node IPv6
[Documentation] Retrieve the IPv6 address from the MicroShift config under node.nodeIPv6
${cfg}= Show Config effective
RETURN ${cfg['node']['nodeIPv6']}

Teardown
[Documentation] Test suite teardown
Teardown Suite With Namespace
Expand All @@ -114,12 +123,6 @@ Remove Dual Stack Config Drop In
[Documentation] Remove dual stack config drop-in
Remove Drop In MicroShift Config 10-dualstack

Initialize Global Variables
[Documentation] Initializes global variables.
Log IP1: ${USHIFT_HOST_IP1} IPv6: ${USHIFT_HOST_IP2}
Should Not Be Empty ${USHIFT_HOST_IP1} USHIFT_HOST_IP1 variable is required
Should Not Be Empty ${USHIFT_HOST_IP2} USHIFT_HOST_IP2 variable is required

Migrate To Dual Stack
[Documentation] Configure MicroShift to enable dual stack network

Expand Down Expand Up @@ -174,5 +177,16 @@ Host Network Pods Should Have Dual Stack IPs
... openshift-dns
... -l dns.operator.openshift.io/daemonset-node-resolver
... .items[*].status.podIPs[*].ip
Should Contain ${pod_ips} ${USHIFT_HOST_IP1}
Should Contain ${pod_ips} ${USHIFT_HOST_IP2}
VAR ${IPV4_FOUND}= False scope=TEST
VAR ${IPV6_FOUND}= False scope=TEST
${pod_ips_list}= Split String ${pod_ips}
FOR ${ip} IN @{pod_ips_list}
${is_ipv6}= Is Ipv6 ${ip}
IF ${is_ipv6}
VAR ${IPV6_FOUND}= True scope=TEST
ELSE
VAR ${IPV4_FOUND}= True scope=TEST
END
END
Should Be True ${IPV4_FOUND} At least one IPv4 address should be found
Should Be True ${IPV6_FOUND} At least one IPv6 address should be found