Skip to content

Commit

Permalink
RDS Core: IPVLAN connectivity test added (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
elenagerman authored Aug 20, 2024
1 parent 7cc57f1 commit 2bc98c1
Show file tree
Hide file tree
Showing 7 changed files with 555 additions and 27 deletions.
47 changes: 47 additions & 0 deletions tests/system-tests/rdscore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,53 @@ for e.g. on `192.168.12.22 1111` on 1st workload and `192.168.12.33 1111` on 2nd
|rdscore_macvlan_deploy_4_target | IPv4 address and port configured on 1st workload | `192.168.12.12 1111` |
|rdscore_macvlan_deploy_4_target_ipv6 | IPv6 address configured on 1st workload | |

### _VerifyIpVlanOnDifferentNodes_

Verifies connectivity between test workloads that use same IPVLAN definition and are scheduled on different nodes.

Test expects `nc` process to listen on IP address(es) on IPVLAN interfaces on both workloads,
for e.g. on `192.168.12.22 1111` on 1st workload and `192.168.12.33 1111` on 2nd workload.

**Requires 2 nodes where the same IPVLAN network is configured**

| paremater | description | example |
|-------------------------------------|--------------------------------------------------|-------------------------------------|
| rdscore_ipvlan_ns_one | Namespace for the test workload | `my-mc-1` |
| rdscore_ipvlan_cm_data_one | Content of configMap that is mounted within pods | |
| rdscore_ipvlan_deploy_img_one | Image used by the test workload | `quay.io/myorg/my-mc-app:1.1` |
| rdscore_ipvlan_deploy_1_cmd | Command executed by 1st container | `["/bin/sh", "-c", "/myapp --run"]` |
| rdscore_ipvlan_deploy_2_cmd | Command executed by 2nd container | `["/bin/sh", "-c", "/myapp --run"]` |
| rdscore_ipvlan_nad_one_name | Name of the IpVlan network | `ip-vlan` |
| rdscore_ipvlan_1_node_selector | Node selector for the 1st workload | `kubernetes.io/hostname: worker-X` |
| rdscore_ipvlan_2_node_selector | Node selector for the 1st workload | `kubernetes.io/hostname: worker-Y` |
| rdscore_ipvlan_deploy_1_target | IPv4 address and port configured on 2nd workload | `192.168.12.22 1111` |
| rdscore_ipvlan_deploy_1_target_ipv6 | IPv6 address configured on 2nd workload | |
| rdscore_ipvlan_deploy_2_target | IPv4 address and port configured on 1st workload | `192.168.12.12 1111` |
| rdscore_ipvlan_deploy_2_target_ipv6 | IPv6 address configured on 1st workload | |

### _VerifyIpVlanOnSameNode_

Verifies connectivity between test workloads that use same IPVLAN definition and are scheduled on the same node.

Test expects `nc` process to listen on IP address(es) on IPVLAN interfaces on both workloads,
for e.g. on `192.168.12.22 1111` on 1st workload and `192.168.12.33 1111` on 2nd workload.

**Requires 1 node where IPVLAN network is configured**

| paremater | description | example |
|-------------------------------------|--------------------------------------------------|-------------------------------------|
| rdscore_ipvlan_ns_one | Namespace for the test workload | `my-mc-1` |
| rdscore_ipvlan_cm_data_one | Content of configMap that is mounted within pods | |
| rdscore_ipvlan_deploy_img_one | Image used by test workloads | `quay.io/myorg/my-mc-app:1.1` |
| rdscore_ipvlan_deploy_3_cmd | Command executed by 1st container | `["/bin/sh", "-c", "/myapp --run"]` |
| rdscore_ipvlan_deploy_4_cmd | Command executed by 2nd container | `["/bin/sh", "-c", "/myapp --run"]` |
| rdscore_ipvlan_nad_one_name | Name of the IpVlan network | `ip-vlan` |
| rdscore_ipvlan_1_node_selector | Node selector for the 1st workload | `kubernetes.io/hostname: worker-X` |
| rdscore_ipvlan_deploy_3_target | IPv4 address and port configured on 2nd workload | `192.168.12.22 1111` |
| rdscore_ipvlan_deploy_3_target_ipv6 | IPv6 address configured on 2nd workload | |
| rdscore_ipvlan_deploy_4_target | IPv4 address and port configured on 1st workload | `192.168.12.12 1111` |
| rdscore_ipvlan_deploy_4_target_ipv6 | IPv6 address configured on 1st workload | |

### _VerifyNMStateNamespaceExists_

Verifies namespace for _NMState_ operator exists
Expand Down
30 changes: 30 additions & 0 deletions tests/system-tests/rdscore/internal/rdscorecommon/hard-reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ func VerifyHardRebootSuite() {

By("Creating MACVLAN workloads on different nodes")
VerifyMacVlanOnDifferentNodes()

By("Creating IPVLAN workloads on the same node")
VerifyIPVlanOnSameNode()

By("Creating IPVLAN workloads on different nodes")
VerifyIPVlanOnDifferentNodes()
})

It("Verifies ungraceful cluster reboot",
Expand Down Expand Up @@ -433,10 +439,20 @@ func VerifyHardRebootSuite() {
It("Verifies MACVLAN workloads on different nodes post hard reboot",
Label("rds-core-post-hard-reboot-macvlan-different-nodes"), reportxml.ID("72568"),
VerifyMACVLANConnectivityOnSameNode)

It("Verifies IPVLAN workloads on the same node post hard reboot",
Label("ipvlan", "verify-ipvlan-same-node"), reportxml.ID("75565"),
VerifyIPVLANConnectivityOnSameNode)

It("Verifies IPVLAN workloads on different nodes post hard reboot",
Label("ipvlan", "verify-ipvlan-different-nodes"), reportxml.ID("75059"),
VerifyIPVLANConnectivityBetweenDifferentNodes)
})
}

// VerifyGracefulRebootSuite container that contains tests for graceful reboot verification.
//
//nolint:funlen
func VerifyGracefulRebootSuite() {
Describe(
"Graceful reboot validation",
Expand All @@ -459,6 +475,12 @@ func VerifyGracefulRebootSuite() {

By("Creating MACVLAN workloads on different nodes")
VerifyMacVlanOnDifferentNodes()

By("Creating IPVLAN workloads on the same node")
VerifyIPVlanOnSameNode()

By("Creating IPVLAN workloads on different nodes")
VerifyIPVlanOnDifferentNodes()
})

It("Verifies graceful cluster reboot",
Expand Down Expand Up @@ -517,5 +539,13 @@ func VerifyGracefulRebootSuite() {
It("Verifies MACVLAN workloads on different nodes post soft reboot",
Label("rds-core-post-soft-reboot-macvlan-different-nodes"), reportxml.ID("72570"),
VerifyMACVLANConnectivityOnSameNode)

It("Verifies IPVLAN workloads on the same node post soft reboot",
Label("ipvlan", "verify-ipvlan-same-node"), reportxml.ID("75564"),
VerifyIPVLANConnectivityOnSameNode)

It("Verifies IPVLAN workloads on different nodes post soft reboot",
Label("ipvlan", "verify-ipvlan-different-nodes"), reportxml.ID("75058"),
VerifyIPVLANConnectivityBetweenDifferentNodes)
})
}
Loading

0 comments on commit 2bc98c1

Please sign in to comment.