Skip to content

Commit

Permalink
pkg/portutil: add ipv6 host ip test
Browse files Browse the repository at this point in the history
Signed-off-by: THLIVSQAZ <[email protected]>
  • Loading branch information
THLIVSQAZ committed Jul 14, 2024
1 parent 99b05e6 commit e7b567c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/portutil/portutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,21 @@ func TestParseFlagP(t *testing.T) {
},
wantErr: false,
},
{
name: "with ipv6 host ip",
args: args{
s: "[::0]:8080:80/tcp",
},
want: []gocni.PortMapping{
{
HostPort: 8080,
ContainerPort: 80,
Protocol: "tcp",
HostIP: "::0",
},
},
wantErr: false,
},
{
name: "with invalid protocol",
args: args{
Expand Down

0 comments on commit e7b567c

Please sign in to comment.