Skip to content

Commit 54af2e4

Browse files
committed
Add additional test
1 parent d36fe7d commit 54af2e4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/lbmanager/lbmanager_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ func TestLBManager_nextFreePort(t *testing.T) {
6565
want: 0,
6666
wantErr: true,
6767
},
68+
{
69+
name: "re-use releaased port",
70+
lbMgr: &LBManager{
71+
Client: fake.NewClientBuilder().WithScheme(scheme()).WithLists(svcListWithPorts(0, 2, 4)).Build(),
72+
LBIP: "0.0.0.0",
73+
PortRangeStart: portRangeStart,
74+
PortRangeSize: portRangeSize,
75+
},
76+
want: 1,
77+
wantErr: false,
78+
},
6879
}
6980

7081
for _, tt := range tests {

0 commit comments

Comments
 (0)