Skip to content

Commit

Permalink
multicast, udn: Add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
Co-authored-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
  • Loading branch information
qinqon and dceara committed Oct 25, 2024
1 parent 8d0fb73 commit 4902a06
Show file tree
Hide file tree
Showing 8 changed files with 557 additions and 357 deletions.
20 changes: 13 additions & 7 deletions go-controller/pkg/ovn/master_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1834,26 +1834,32 @@ func newClusterJoinSwitch() *nbdb.LogicalSwitch {
}
}

func newNetworkClusterPortGroup(netControllerName string) *nbdb.PortGroup {
func newNetworkClusterPortGroup(netInfo util.NetInfo) *nbdb.PortGroup {
netControllerName := getNetworkControllerName(netInfo.GetNetworkName())
fakeController := getFakeController(netControllerName)
pgIDs := fakeController.getClusterPortGroupDbIDs(types.ClusterPortGroupNameBase)
pg := libovsdbutil.BuildPortGroup(pgIDs, nil, nil)
pg.UUID = pgIDs.String()
return pg
}

func newClusterPortGroup() *nbdb.PortGroup {
return newNetworkClusterPortGroup(DefaultNetworkControllerName)
}

func newRouterPortGroup() *nbdb.PortGroup {
fakeController := getFakeController(DefaultNetworkControllerName)
func newNetworkRouterPortGroup(netInfo util.NetInfo) *nbdb.PortGroup {
netControllerName := getNetworkControllerName(netInfo.GetNetworkName())
fakeController := getFakeController(netControllerName)
pgIDs := fakeController.getClusterPortGroupDbIDs(types.ClusterRtrPortGroupNameBase)
pg := libovsdbutil.BuildPortGroup(pgIDs, nil, nil)
pg.UUID = pgIDs.String()
return pg
}

func newClusterPortGroup() *nbdb.PortGroup {
return newNetworkClusterPortGroup(&util.DefaultNetInfo{})
}

func newRouterPortGroup() *nbdb.PortGroup {
return newNetworkRouterPortGroup(&util.DefaultNetInfo{})
}

func newOVNClusterRouter() *nbdb.LogicalRouter {
return &nbdb.LogicalRouter{
UUID: types.OVNClusterRouter + "-UUID",
Expand Down
Loading

0 comments on commit 4902a06

Please sign in to comment.