Skip to content

Commit d8e6021

Browse files
committed
Add explicit secondary UDN and CUDN test cases
Add pod-to-pod test cases for secondary CUDN and UDN Layer3 and Layer2 networks, plus CUDN localnet, with dedicated network names and CIDRs for each permutation. Create all selected secondary networks per test entry and attach their NADs to shared pre-provisioned pods while selecting the exact network for each test. Update evaluator configs, fixtures, and docs. Signed-off-by: Venkat Kunaparaju <vkunaparaju@nvidia.com>
1 parent e0cb446 commit d8e6021

11 files changed

Lines changed: 809 additions & 54 deletions

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ dpu_node_host_label: (37)
151151
| 66 | HOST_TO_LOAD_BALANCER_TO_HOST_SAME_NODE |
152152
| 67 | HOST_TO_LOAD_BALANCER_TO_HOST_DIFF_NODE |
153153
| 68 | POD_TO_EXTERNAL_EGRESS |
154+
| 69 | CUDN_LAYER3_POD_TO_POD_SAME_NODE |
155+
| 70 | CUDN_LAYER3_POD_TO_POD_DIFF_NODE |
156+
| 71 | UDN_LAYER3_POD_TO_POD_SAME_NODE |
157+
| 72 | UDN_LAYER3_POD_TO_POD_DIFF_NODE |
158+
| 73 | CUDN_LAYER2_POD_TO_POD_SAME_NODE |
159+
| 74 | CUDN_LAYER2_POD_TO_POD_DIFF_NODE |
160+
| 75 | UDN_LAYER2_POD_TO_POD_SAME_NODE |
161+
| 76 | UDN_LAYER2_POD_TO_POD_DIFF_NODE |
162+
| 77 | CUDN_LOCALNET_POD_TO_POD_SAME_NODE |
163+
| 78 | CUDN_LOCALNET_POD_TO_POD_DIFF_NODE |
154164
4. "duration" - The duration that each individual test will run for.
155165
5. "pre_provision" - (Optional) Whether to pre-provision all pods and services once before the test run begins, rather than creating and tearing them down per test case. Defaults to false. Takes in "true/false".
156166
6. "name" - This is the connection name. Any string value to identify the connection.
@@ -177,7 +187,7 @@ dpu_node_host_label: (37)
177187
| measure_power | Measure Power Usage |
178188
| validate_offload | Verify OvS Offload |
179189
21. "test_cases" - (Optional) Restrict a plugin to run only for the specified test cases. Uses the same format as the top-level `test_cases` field. By default, the plugin runs for every test case.
180-
22. "secondary_network_nad" - (Optional) - The name of the secondary network for multi-homing and multi-networkpolicies tests. For tests except 27-31, the primary network will be used if unspecified (the default which is None). For mandatory tests 27-31 it defaults to "tft-secondary" if not set. Can be overridden per-node using the server/client level `secondary_network_nad` fields. The framework automatically creates and cleans up the NAD when these test cases are selected or when SRIOV nodes reference a secondary NAD. Subnets, MTU, and topology default to `10.193.0.0/16/26`, `1500`, and `layer3`, overridable via `TFT_SECONDARY_NAD_SUBNETS`, `TFT_SECONDARY_NAD_MTU`, and `TFT_SECONDARY_NAD_TOPOLOGY`.
190+
22. "secondary_network_nad" - (Optional) - The name of the secondary network for multi-homing and multi-networkpolicies tests. For mandatory tests 27-31 it defaults to "tft-secondary" if not set and can be overridden per-node using the server/client level `secondary_network_nad` fields. Tests 69-78 instead use the generated NAD selected by each test case and do not use this option. The framework automatically creates and cleans up the regular secondary NAD when required. Subnets, MTU, and topology default to `10.193.0.0/16/26`, `1500`, and `layer3`, overridable via `TFT_SECONDARY_NAD_SUBNETS`, `TFT_SECONDARY_NAD_MTU`, and `TFT_SECONDARY_NAD_TOPOLOGY`.
181191
23. "resource_name" - (Optional) - The resource name for tests that require resource limit and requests to be set. This field is optional and will default to None if not set, but if secondary network nad is defined, traffic flow test tool will try to autopopulate resource_name based on the secondary+network_nad provided.
182192
24. "cpu_request" - (Optional) CPU request for server and client pods (e.g. "10m", "500m"). No CPU request is set if omitted.
183193
25. "cpu_limit" - (Optional) CPU limit for server and client pods (e.g. "20m", "1000m"). No CPU limit is set if omitted.
@@ -207,15 +217,21 @@ dpu_node_host_label: (37)
207217

208218
See the [OVN-Kubernetes UDN documentation](https://github.com/ovn-kubernetes/ovn-kubernetes/blob/master/docs/features/user-defined-networks/user-defined-networks.md) for details on User Defined Networks.
209219

210-
Test cases 37-47 run traffic over OVN-Kubernetes User Defined Networks. The framework creates and cleans up a `{namespace}-udn` namespace with the appropriate UDN CRDs automatically. NetworkPolicies and LoadBalancer services for UDN tests are also created in (and torn down from) the `{namespace}-udn` namespace.
220+
Test cases 37-47 and 69-78 run traffic over OVN-Kubernetes User Defined Networks. The framework creates and cleans up a `{namespace}-udn` namespace with the appropriate UDN CRDs automatically. NetworkPolicies and LoadBalancer services for UDN tests are also created in (and torn down from) the `{namespace}-udn` namespace.
211221

212-
- **37-47** (Primary UDN): Layer3 network replacing the pod's default network.
222+
- **37-47** (Primary UDN): Network replacing the pod's default network. Its mode, topology, and transport are configured through `udn_primary_network`.
213223
- **37-42**: pod-to-pod, ClusterIP, and NodePort.
214224
- **43**: pod-to-external (egress out of the UDN to the public internet).
215225
- **44-45**: NetworkPolicy enforcement on the primary UDN (deny / allow).
216226
- **46-47**: pod-to-LoadBalancer-to-pod (same / different node).
227+
- **69-78** (Secondary UDN/CUDN): Pod-to-pod tests over a second interface.
228+
- **69-70**: Layer3 CUDN.
229+
- **71-72**: Layer3 UDN.
230+
- **73-74**: Layer2 CUDN.
231+
- **75-76**: Layer2 UDN.
232+
- **77-78**: Localnet CUDN.
217233

218-
CIDRs default to `15.1.0.0/16` (primary), `15.2.0.0/16` (secondary), and `15.3.0.0/24` (localnet), overridable via `TFT_UDN_PRIMARY_CIDR`, `TFT_UDN_SECONDARY_CIDR`, and `TFT_UDN_LOCALNET_CIDR`. The localnet physical network name defaults to `physnet`, overridable via `TFT_UDN_LOCALNET_PHYSICAL_NETWORK`. Reference manifests are in `manifests/udn.yaml.j2` and `manifests/cudn.yaml.j2`.
234+
The primary CIDR defaults to `15.1.0.0/16`. Secondary CIDRs default to `15.2.0.0/16` (Layer3 CUDN), `15.3.0.0/16` (Layer3 UDN), `15.4.0.0/16` (Layer2 CUDN), `15.5.0.0/16` (Layer2 UDN), and `15.6.0.0/24` (localnet CUDN). Each CIDR has a corresponding environment variable listed below. The localnet physical network name defaults to `physnet`, overridable via `TFT_CUDN_LOCALNET_PHYSICAL_NETWORK`. Reference manifests are in `manifests/udn.yaml.j2` and `manifests/cudn.yaml.j2`.
219235

220236
`udn_primary_network` supports `mode` values `udn` and `cudn`, `topology` values `layer3` and `layer2`, and `transport` values `overlay` and `no-overlay`. `no-overlay` requires `mode: cudn` and `topology: layer3`.
221237

@@ -420,9 +436,12 @@ match. The `EgressIP` resource and the egress node's labels are removed during c
420436
- `TFT_KUBECONFIG`, `TFT_KUBECONFIG_INFRA` to overwrite the kubeconfigs from the configuration
421437
file. See also the "--kubeconfig" and "--kubeconfig-infra" command line options.
422438
- `TFT_UDN_PRIMARY_CIDR` CIDR for primary UDN tests. Defaults to `15.1.0.0/16`.
423-
- `TFT_UDN_SECONDARY_CIDR` CIDR for secondary UDN tests. Defaults to `15.2.0.0/16`.
424-
- `TFT_UDN_LOCALNET_CIDR` CIDR for localnet UDN tests. Defaults to `15.3.0.0/24`.
425-
- `TFT_UDN_LOCALNET_PHYSICAL_NETWORK` physical network name for localnet UDN tests. Defaults to `physnet`.
439+
- `TFT_CUDN_SECONDARY_LAYER3_CIDR` CIDR for secondary Layer3 CUDN tests. Defaults to `15.2.0.0/16`.
440+
- `TFT_UDN_SECONDARY_LAYER3_CIDR` CIDR for secondary Layer3 UDN tests. Defaults to `15.3.0.0/16`.
441+
- `TFT_CUDN_SECONDARY_LAYER2_CIDR` CIDR for secondary Layer2 CUDN tests. Defaults to `15.4.0.0/16`.
442+
- `TFT_UDN_SECONDARY_LAYER2_CIDR` CIDR for secondary Layer2 UDN tests. Defaults to `15.5.0.0/16`.
443+
- `TFT_CUDN_SECONDARY_LOCALNET_CIDR` CIDR for secondary localnet CUDN tests. Defaults to `15.6.0.0/24`.
444+
- `TFT_CUDN_LOCALNET_PHYSICAL_NETWORK` physical network name for localnet CUDN tests. Defaults to `physnet`.
426445
- `TFT_UDN_NO_OVERLAY_OUTBOUND_SNAT_ENABLED` outbound SNAT setting for no-overlay CUDNs. Defaults to `true`.
427446
- `TFT_UDN_NO_OVERLAY_ROUTING_MANAGED` routing mode for no-overlay CUDNs. Defaults to `false`.
428447
- `TFT_EXTERNAL_URL` URL to curl for external connectivity tests (e.g. `http://google.com`).

config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ tft:
2828
- name: measure_cpu
2929
- name: measure_power
3030
- name: validate_offload
31-
# "secondary_network_nad" is always used for tests 27-29.
31+
# "secondary_network_nad" is always used for tests 27-31.
3232
# For these tests, it defaults to "tft-secondary". For other tests,
3333
# leaving "secondary_network_nad" unset means to use the primary
34-
# network.
34+
# network. Tests 69-78 use their generated test-defined NADs instead.
3535
# "resource_name" is the resource name for SRIOV pods, where
3636
# the resource requests and limits are configured. If unset and a
3737
# "secondary_network_nad" is used, the "resource_name" is detected.

eval-config.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,56 @@ IPERF_TCP:
279279
threshold: 18
280280
Reverse:
281281
threshold: 10
282+
- id: CUDN_LAYER3_POD_TO_POD_SAME_NODE
283+
Normal:
284+
threshold: 18
285+
Reverse:
286+
threshold: 10
287+
- id: CUDN_LAYER3_POD_TO_POD_DIFF_NODE
288+
Normal:
289+
threshold: 18
290+
Reverse:
291+
threshold: 10
292+
- id: UDN_LAYER3_POD_TO_POD_SAME_NODE
293+
Normal:
294+
threshold: 18
295+
Reverse:
296+
threshold: 10
297+
- id: UDN_LAYER3_POD_TO_POD_DIFF_NODE
298+
Normal:
299+
threshold: 18
300+
Reverse:
301+
threshold: 10
302+
- id: CUDN_LAYER2_POD_TO_POD_SAME_NODE
303+
Normal:
304+
threshold: 18
305+
Reverse:
306+
threshold: 10
307+
- id: CUDN_LAYER2_POD_TO_POD_DIFF_NODE
308+
Normal:
309+
threshold: 18
310+
Reverse:
311+
threshold: 10
312+
- id: UDN_LAYER2_POD_TO_POD_SAME_NODE
313+
Normal:
314+
threshold: 18
315+
Reverse:
316+
threshold: 10
317+
- id: UDN_LAYER2_POD_TO_POD_DIFF_NODE
318+
Normal:
319+
threshold: 18
320+
Reverse:
321+
threshold: 10
322+
- id: CUDN_LOCALNET_POD_TO_POD_SAME_NODE
323+
Normal:
324+
threshold: 18
325+
Reverse:
326+
threshold: 10
327+
- id: CUDN_LOCALNET_POD_TO_POD_DIFF_NODE
328+
Normal:
329+
threshold: 18
330+
Reverse:
331+
threshold: 10
282332
IPERF_UDP:
283333
- id: POD_TO_POD_SAME_NODE
284334
Normal:
@@ -560,3 +610,53 @@ IPERF_UDP:
560610
threshold: 5
561611
Reverse:
562612
threshold: 5
613+
- id: CUDN_LAYER3_POD_TO_POD_SAME_NODE
614+
Normal:
615+
threshold: 5
616+
Reverse:
617+
threshold: 5
618+
- id: CUDN_LAYER3_POD_TO_POD_DIFF_NODE
619+
Normal:
620+
threshold: 5
621+
Reverse:
622+
threshold: 5
623+
- id: UDN_LAYER3_POD_TO_POD_SAME_NODE
624+
Normal:
625+
threshold: 5
626+
Reverse:
627+
threshold: 5
628+
- id: UDN_LAYER3_POD_TO_POD_DIFF_NODE
629+
Normal:
630+
threshold: 5
631+
Reverse:
632+
threshold: 5
633+
- id: CUDN_LAYER2_POD_TO_POD_SAME_NODE
634+
Normal:
635+
threshold: 5
636+
Reverse:
637+
threshold: 5
638+
- id: CUDN_LAYER2_POD_TO_POD_DIFF_NODE
639+
Normal:
640+
threshold: 5
641+
Reverse:
642+
threshold: 5
643+
- id: UDN_LAYER2_POD_TO_POD_SAME_NODE
644+
Normal:
645+
threshold: 5
646+
Reverse:
647+
threshold: 5
648+
- id: UDN_LAYER2_POD_TO_POD_DIFF_NODE
649+
Normal:
650+
threshold: 5
651+
Reverse:
652+
threshold: 5
653+
- id: CUDN_LOCALNET_POD_TO_POD_SAME_NODE
654+
Normal:
655+
threshold: 5
656+
Reverse:
657+
threshold: 5
658+
- id: CUDN_LOCALNET_POD_TO_POD_DIFF_NODE
659+
Normal:
660+
threshold: 5
661+
Reverse:
662+
threshold: 5

task.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,9 @@ def _shares_pre_provisioned_secondary_pod(self) -> bool:
415415
)
416416

417417
def _get_effective_secondary_network_nad(self) -> str:
418-
if self.ts.test_case_id.is_udn_localnet:
419-
return f"{self.get_namespace()}/tft-localnet"
420-
if self.ts.test_case_id.is_udn_secondary:
421-
return f"{self.get_namespace()}/tft-secondary"
418+
udn_network_spec = self.ts.test_case_id.udn_network_spec
419+
if udn_network_spec is not None:
420+
return f"{self.get_namespace()}/{udn_network_spec.name}"
422421
nad = self._get_node_secondary_network_nad()
423422
if nad is not None:
424423
if "/" not in nad:
@@ -430,6 +429,15 @@ def _get_effective_secondary_network_nad(self) -> str:
430429
)
431430

432431
def _get_pod_secondary_network_nads(self) -> tuple[str, ...]:
432+
if self.ts.test_case_id.is_udn and self._shares_pre_provisioned_secondary_pod():
433+
namespace = self.get_namespace()
434+
return tuple(
435+
dict.fromkeys(
436+
f"{namespace}/{network.name}"
437+
for test_case in self.ts.cfg_descr.get_tft().test_cases
438+
if (network := test_case.udn_network_spec) is not None
439+
)
440+
)
433441
if (
434442
self._get_node_secondary_network_nad()
435443
or self.ts.connection.secondary_network_nad

tests/eval-config-2.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,56 @@ IPERF_TCP:
279279
Reverse:
280280
threshold: 10
281281
id: 68
282+
- Normal:
283+
threshold: 18
284+
Reverse:
285+
threshold: 10
286+
id: 69
287+
- Normal:
288+
threshold: 18
289+
Reverse:
290+
threshold: 10
291+
id: 70
292+
- Normal:
293+
threshold: 18
294+
Reverse:
295+
threshold: 10
296+
id: 71
297+
- Normal:
298+
threshold: 18
299+
Reverse:
300+
threshold: 10
301+
id: 72
302+
- Normal:
303+
threshold: 18
304+
Reverse:
305+
threshold: 10
306+
id: 73
307+
- Normal:
308+
threshold: 18
309+
Reverse:
310+
threshold: 10
311+
id: 74
312+
- Normal:
313+
threshold: 18
314+
Reverse:
315+
threshold: 10
316+
id: 75
317+
- Normal:
318+
threshold: 18
319+
Reverse:
320+
threshold: 10
321+
id: 76
322+
- Normal:
323+
threshold: 18
324+
Reverse:
325+
threshold: 10
326+
id: 77
327+
- Normal:
328+
threshold: 18
329+
Reverse:
330+
threshold: 10
331+
id: 78
282332
IPERF_UDP:
283333
- Normal:
284334
threshold: 5
@@ -560,3 +610,53 @@ IPERF_UDP:
560610
Reverse:
561611
threshold: 5
562612
id: 68
613+
- Normal:
614+
threshold: 5
615+
Reverse:
616+
threshold: 5
617+
id: 69
618+
- Normal:
619+
threshold: 5
620+
Reverse:
621+
threshold: 5
622+
id: 70
623+
- Normal:
624+
threshold: 5
625+
Reverse:
626+
threshold: 5
627+
id: 71
628+
- Normal:
629+
threshold: 5
630+
Reverse:
631+
threshold: 5
632+
id: 72
633+
- Normal:
634+
threshold: 5
635+
Reverse:
636+
threshold: 5
637+
id: 73
638+
- Normal:
639+
threshold: 5
640+
Reverse:
641+
threshold: 5
642+
id: 74
643+
- Normal:
644+
threshold: 5
645+
Reverse:
646+
threshold: 5
647+
id: 75
648+
- Normal:
649+
threshold: 5
650+
Reverse:
651+
threshold: 5
652+
id: 76
653+
- Normal:
654+
threshold: 5
655+
Reverse:
656+
threshold: 5
657+
id: 77
658+
- Normal:
659+
threshold: 5
660+
Reverse:
661+
threshold: 5
662+
id: 78

0 commit comments

Comments
 (0)