Skip to content

Commit

Permalink
feature: add IPv6 validation and testcase
Browse files Browse the repository at this point in the history
Signed-off-by: Leno Hou <[email protected]>
  • Loading branch information
houstar committed Nov 6, 2018
1 parent 41ef0fb commit 72de7de
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion daemon/mgr/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,34 @@ func Test_getIpamConfig(t *testing.T) {
want1: []*libnetwork.IpamConf{},
wantErr: false,
},
{
name: "getIpamConfigIPv6Normal",
args: args{
data: []apitypes.IPAMConfig{
{
AuxAddress: map[string]string{
"foo": "bar",
},
Gateway: "2002:db8:1::1",
IPRange: "2002:db8:1::1/68",
Subnet: "2002:db8:1::1/64",
},
},
},
want: []*libnetwork.IpamConf{},
wantErr: false,
want1: []*libnetwork.IpamConf{
{
PreferredPool: "2002:db8:1::1/64",
SubPool: "2002:db8:1::1/68",
Gateway: "2002:db8:1::1",
AuxAddresses: map[string]string{
"foo": "bar",
},
},
},
},
// TODO: add Invalid IPv4 subnet
// TODO: add IPv6 test

}
for _, tt := range tests {
Expand Down

0 comments on commit 72de7de

Please sign in to comment.