-
Notifications
You must be signed in to change notification settings - Fork 228
USHIFT-3772: Dual stack RF e2e tests #3681
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
149a217
USHIFT-3772: Add dual stack network asset
pacevedom 422fabb
USHIFT-3772: Add dual stack network handling to boot
pacevedom 86305f6
USHIFT-3772: Add new function to ipv6 resource lib
pacevedom 0ebf474
USHIFT-3772: Add dual stack robot tests
pacevedom 258a7bf
USHIFT-3772: Add dual stack scenario
pacevedom 0a80d9a
USHIFT-3772: RF nits
pacevedom 565f96b
USHIFT-3772: Update manage-vm.sh IP retrieval for vms
pacevedom 6ef994f
USHIFT-3772: Update dualstack.robot
pacevedom 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <network> | ||
| <name>${VM_DUAL_STACK_NETWORK}</name> | ||
| <forward mode="nat"> | ||
| <nat ipv6='yes'> | ||
| <port start='1024' end='65535'/> | ||
| </nat> | ||
| </forward> | ||
| <ip address='192.168.113.1' netmask='255.255.255.0' localPtr='yes'> | ||
| <dhcp> | ||
| <range start='192.168.113.100' end='192.168.113.254'/> | ||
| </dhcp> | ||
| </ip> | ||
| <ip family="ipv6" address="2001:db9:ca7:ff::1" prefix="96"> | ||
| <dhcp> | ||
| <range start="2001:db9:ca7:ff::1000" end="2001:db9:ca7:ff::2000" /> | ||
| </dhcp> | ||
| </ip> | ||
| </network> |
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,16 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: hello-microshift | ||
| labels: | ||
| app: hello-microshift | ||
| spec: | ||
| ipFamilies: | ||
| - IPv6 | ||
| selector: | ||
| app: hello-microshift | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| protocol: TCP | ||
| type: ClusterIP |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| scenario_create_vms() { | ||
| prepare_kickstart host1 kickstart.ks.template rhel-9.4-microshift-source | ||
| launch_vm host1 rhel-9.4 "${VM_DUAL_STACK_NETWORK}" | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| remove_vm host1 | ||
| } | ||
|
|
||
| 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 | ||
| } |
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,154 @@ | ||
| *** Settings *** | ||
| Documentation Tests related to MicroShift running in a dual stack ipv4+6 host | ||
|
|
||
| Resource ../../resources/common.resource | ||
| Resource ../../resources/oc.resource | ||
| Resource ../../resources/ostree-health.resource | ||
| Resource ../../resources/microshift-network.resource | ||
| Resource ../../resources/microshift-config.resource | ||
| Library ../../resources/libipv6.py | ||
|
|
||
| Suite Setup Setup | ||
| Suite Teardown Teardown | ||
|
|
||
| Test Tags ipv6 network | ||
|
|
||
|
|
||
| *** Variables *** | ||
| ${USHIFT_HOST_IP1} ${EMPTY} | ||
| ${USHIFT_HOST_IP2} ${EMPTY} | ||
| ${HOSTNAME} hello-microshift.dualstack.cluster.local | ||
|
|
||
|
|
||
| *** Test Cases *** | ||
| Verify New Pod Works With IPv6 | ||
| [Documentation] Verify IPv6 services are routable. | ||
| [Setup] Run Keywords | ||
| ... Save Default MicroShift Config | ||
| ... Migrate To Dual Stack | ||
| ... Create Hello MicroShift Pod | ||
| ... 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} | ||
| ... ushift_port=${HTTP_PORT} | ||
| ... hostname=${HOSTNAME} | ||
| Wait Until Keyword Succeeds 10x 6s | ||
| ... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IP2} | ||
| ... ushift_port=${HTTP_PORT} | ||
| ... hostname=${HOSTNAME} | ||
|
pacevedom marked this conversation as resolved.
Outdated
|
||
|
|
||
| [Teardown] Run Keywords | ||
| ... Delete Hello MicroShift Route | ||
| ... Delete Hello MicroShift Pod And Service | ||
| ... Wait For Service Deletion With Timeout | ||
| ... Restore Default MicroShift Config | ||
| ... Restart MicroShift | ||
|
|
||
| Verify New Pod Works With IPv4 | ||
| [Documentation] Verify IPv4 services are routable. | ||
| [Setup] Run Keywords | ||
| ... Save Default MicroShift Config | ||
| ... Migrate To Dual Stack | ||
| ... Create Hello MicroShift Pod | ||
| ... 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} | ||
| ... ushift_port=${HTTP_PORT} | ||
| ... hostname=${HOSTNAME} | ||
| Wait Until Keyword Succeeds 10x 6s | ||
| ... Access Hello Microshift Success ushift_ip=${USHIFT_HOST_IP2} | ||
| ... ushift_port=${HTTP_PORT} | ||
| ... hostname=${HOSTNAME} | ||
|
|
||
| [Teardown] Run Keywords | ||
| ... Delete Hello MicroShift Route | ||
| ... Delete Hello MicroShift Pod And Service | ||
| ... Wait For Service Deletion With Timeout | ||
| ... Restore Default MicroShift Config | ||
| ... Restart MicroShift | ||
|
|
||
|
|
||
| *** Keywords *** | ||
| Setup | ||
| [Documentation] Test suite setup | ||
| Initialize Global Variables | ||
| Login MicroShift Host | ||
| Setup Suite With Namespace | ||
| Wait Until Greenboot Health Check Exited | ||
|
|
||
| Teardown | ||
| [Documentation] Test suite teardown | ||
| Teardown Suite With Namespace | ||
| Logout MicroShift Host | ||
|
|
||
| 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 | ||
|
|
||
| ${dual_stack}= CATENATE SEPARATOR=\n | ||
| ... --- | ||
| ... network: | ||
| ... \ \ clusterNetwork: [10.42.0.0/16, fd01::/48] | ||
| ... \ \ serviceNetwork: [10.43.0.0/16, fd02::/112] | ||
| ${replaced}= Replace MicroShift Config ${dual_stack} | ||
| Upload MicroShift Config ${replaced} | ||
| Restart MicroShift | ||
|
|
||
| Delete Hello MicroShift Route | ||
| [Documentation] Delete route for cleanup. | ||
| Oc Delete route/hello-microshift -n ${NAMESPACE} | ||
|
|
||
| Wait For Service Deletion With Timeout | ||
| [Documentation] Polls for service and endpoint by "app=hello-microshift" label. Fails if timeout | ||
| ... expires. This check is unique to this test suite because each test here reuses the same namespace. Since | ||
| ... the tests reuse the service name, a small race window exists between the teardown of one test and the setup | ||
| ... of the next. This produces flakey failures when the service or endpoint names collide. | ||
| Wait Until Keyword Succeeds 30s 1s | ||
| ... Network APIs With Test Label Are Gone | ||
|
|
||
| Expose Hello MicroShift Service Via Route IPv4 | ||
| [Documentation] Expose the "hello microshift" application through the Route | ||
| Run With Kubeconfig oc apply -n ${NAMESPACE} -f assets/hello-microshift-service.yaml | ||
| Oc Expose svc hello-microshift --hostname ${HOSTNAME} -n ${NAMESPACE} | ||
|
|
||
| Expose Hello MicroShift Service Via Route IPv6 | ||
| [Documentation] Expose the "hello microshift" application through the Route | ||
| Run With Kubeconfig oc apply -n ${NAMESPACE} -f assets/hello-microshift-service-ipv6.yaml | ||
| Oc Expose svc hello-microshift --hostname ${HOSTNAME} -n ${NAMESPACE} | ||
|
|
||
| Network APIs With Test Label Are Gone | ||
| [Documentation] Check for service and endpoint by "app=hello-microshift" label. Succeeds if response matches | ||
| ... "No resources found in <namespace> namespace." Fail if not. | ||
| ${match_string}= Catenate No resources found in ${NAMESPACE} namespace. | ||
| ${match_string}= Remove String ${match_string} " | ||
| ${response}= Run With Kubeconfig oc get svc,ep -l app\=hello-microshift -n ${NAMESPACE} | ||
| Should Be Equal As Strings ${match_string} ${response} strip_spaces=True | ||
|
pacevedom marked this conversation as resolved.
Outdated
|
||
|
|
||
| Restart Router | ||
| [Documentation] Restart the router and wait for readiness again. The router is sensitive to apiserver | ||
| ... downtime and might need a restart (after the apiserver is ready) to resync all the routes. | ||
| Run With Kubeconfig oc rollout restart deployment router-default -n openshift-ingress | ||
| Named Deployment Should Be Available router-default openshift-ingress 5m | ||
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.