Skip to content

Commit 5ece846

Browse files
committed
e2e: add VRF-Lite test cases
Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
1 parent edb05ca commit 5ece846

File tree

8 files changed

+1455
-44
lines changed

8 files changed

+1455
-44
lines changed

test/e2e/deploymentconfig/api/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package api
44
// Remove when OVN-Kubernetes exposes its config via an API.
55
type DeploymentConfig interface {
66
OVNKubernetesNamespace() string
7+
FRRK8sNamespace() string
78
ExternalBridgeName() string
89
PrimaryInterfaceName() string
910
}

test/e2e/deploymentconfig/configs/kind/kind.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ func (k kind) OVNKubernetesNamespace() string {
3333
return "ovn-kubernetes"
3434
}
3535

36+
func (k kind) FRRK8sNamespace() string {
37+
return "frr-k8s-system"
38+
}
39+
3640
func (k kind) ExternalBridgeName() string {
3741
return "breth0"
3842
}

test/e2e/network_segmentation.go

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,31 +1887,17 @@ func generateLayer3Subnets(cidrs string) []string {
18871887

18881888
// userDefinedNetworkReadyFunc returns a function that checks for the NetworkCreated condition in the provided udn
18891889
func userDefinedNetworkReadyFunc(client dynamic.Interface, namespace, name string) func() error {
1890-
return func() error {
1891-
udn, err := client.Resource(udnGVR).Namespace(namespace).Get(context.Background(), name, metav1.GetOptions{}, "status")
1892-
if err != nil {
1893-
return err
1894-
}
1895-
conditions, err := getConditions(udn)
1896-
if err != nil {
1897-
return err
1898-
}
1899-
if len(conditions) == 0 {
1900-
return fmt.Errorf("no conditions found in: %v", udn)
1901-
}
1902-
for _, condition := range conditions {
1903-
if condition.Type == "NetworkCreated" && condition.Status == metav1.ConditionTrue {
1904-
return nil
1905-
}
1906-
}
1907-
return fmt.Errorf("no NetworkCreated condition found in: %v", udn)
1908-
}
1890+
return networkReadyFunc(client.Resource(udnGVR).Namespace(namespace), name)
19091891
}
19101892

19111893
// userDefinedNetworkReadyFunc returns a function that checks for the NetworkCreated condition in the provided cluster udn
19121894
func clusterUserDefinedNetworkReadyFunc(client dynamic.Interface, name string) func() error {
1895+
return networkReadyFunc(client.Resource(clusterUDNGVR), name)
1896+
}
1897+
1898+
func networkReadyFunc(client dynamic.ResourceInterface, name string) func() error {
19131899
return func() error {
1914-
cUDN, err := client.Resource(clusterUDNGVR).Get(context.Background(), name, metav1.GetOptions{}, "status")
1900+
cUDN, err := client.Get(context.Background(), name, metav1.GetOptions{}, "status")
19151901
if err != nil {
19161902
return err
19171903
}

0 commit comments

Comments
 (0)