@@ -385,13 +385,6 @@ var _ = g.Describe("[sig-network][OCPFeatureGate:RouteAdvertisements][Feature:Ro
385385
386386 var err error
387387 var snifferPodsNodes []string
388- // Check if the cluster is in local gateway mode
389- network , err := oc .AdminOperatorClient ().OperatorV1 ().Networks ().Get (context .TODO (), "cluster" , metav1.GetOptions {})
390- o .Expect (err ).NotTo (o .HaveOccurred ())
391- if network .Spec .DefaultNetwork .OVNKubernetesConfig .GatewayConfig != nil && network .Spec .DefaultNetwork .OVNKubernetesConfig .GatewayConfig .RoutingViaHost && testCUDNTopology == "layer2" {
392- // TODO: unskip once CORENET-5881 is done.
393- skipper .Skipf ("Skipping Layer2 UDN advertisements test for local gateway mode" )
394- }
395388 if testCUDNTopology == "layer2" {
396389 // Running the packet sniffer on all nodes in the cluster for Layer2 UDN
397390 nodes , err := clientset .CoreV1 ().Nodes ().List (context .TODO (), metav1.ListOptions {})
@@ -469,7 +462,6 @@ var _ = g.Describe("[sig-network][OCPFeatureGate:RouteAdvertisements][Feature:Ro
469462 err := runOcWithRetryIgnoreOutput (oc .AsAdmin (), "delete" , "deploy" , deployName )
470463 errors .Join (err , runOcWithRetryIgnoreOutput (oc .AsAdmin (), "delete" , "pod" , "--all" ))
471464 errors .Join (err , runOcWithRetryIgnoreOutput (oc .AsAdmin ().WithoutNamespace (), "delete" , "ra" , testCUDNName ))
472- errors .Join (err , runOcWithRetryIgnoreOutput (oc .AsAdmin ().WithoutNamespace (), "delete" , "ra" , testCUDNName ))
473465 errors .Join (err , runOcWithRetryIgnoreOutput (oc .AsAdmin ().WithoutNamespace (), "delete" , "clusteruserdefinednetwork" , testCUDNName ))
474466 errors .Join (err , deallocateSubnets (oc , userDefinedNetworkIPv4Subnet , userDefinedNetworkIPv6Subnet ))
475467 cleanup ()
@@ -516,18 +508,20 @@ var _ = g.Describe("[sig-network][OCPFeatureGate:RouteAdvertisements][Feature:Ro
516508 o .Eventually (workaroundOCPBUGS56488 ).WithArguments (oc ).WithTimeout (3 * time .Minute ).WithPolling (5 * time .Second ).Should (o .BeTrue ())
517509 })
518510
519- g .AfterEach (func () {
520- o .Expect (func () error {
521- err := runOcWithRetryIgnoreOutput (oc .AsAdmin (), "delete" , "nncp" , "extranet" )
522- errors .Join (err , afterEach ())
523- return err
524- }()).To (o .Succeed ())
525- })
526-
527511 test := func (topology string ) {
528512 // general prerequisites
529513 beforeEach (vrfLiteCUDNName , "auto" , topology , vrfLiteSnifferInterface )
530514
515+ // cleanup the VRF-Lite configuration
516+ defer func () {
517+ o .Expect (func () error {
518+ err := runOcWithRetryIgnoreOutput (oc .AsAdmin (), "delete" , "nncp" , "extranet" )
519+ errors .Join (err , afterEach ())
520+ errors .Join (err , runOcWithRetryIgnoreOutput (oc .AsAdmin (), "delete" , "ds" , packetSnifferDaemonSet .Name , "-n" , snifferNamespace ))
521+ return err
522+ }()).To (o .Succeed ())
523+ }()
524+
531525 // we shouldn't need to do this but we have to because of
532526 // https://issues.redhat.com/browse/RHEL-89914
533527 // recycle the VRF until it becomes managed
@@ -563,12 +557,11 @@ var _ = g.Describe("[sig-network][OCPFeatureGate:RouteAdvertisements][Feature:Ro
563557
564558 // All VRF-Lite checks for 'vrfLiteCUDNName' need to happen on a
565559 // single test (or otherwise we should resort to a serial job)
566- // This test has a long timeout due to its serial nature and also
567- // because of OCPBUGS-56488
560+ // This test has a long timeout due to its serial nature, testing both
561+ // Layer 3 and Layer 2 topologies serially, and also because of OCPBUGS-56488
568562 g .It ("Pods should be able to communicate on a secondary network [Timeout:30m]" , func () {
569563 g .By ("testing with a layer 3 CUDN" , func () { test ("layer3" ) })
570- // TODO: Add test for layer 2 UDN once CORENET-5881 is done.
571- //g.By("testing with a layer 2 CUDN", func() { test("layer2") })
564+ g .By ("testing with a layer 2 CUDN" , func () { test ("layer2" ) })
572565 })
573566 })
574567 })
0 commit comments