Skip to content

Commit

Permalink
Add unit-test
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
  • Loading branch information
wenqiq committed Mar 20, 2022
1 parent d3cdebd commit f8eaabb
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion pkg/antctl/command_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,36 @@ foo2
Pods: []common.GroupMember{},
},
},
expected: `NAME POD-IPS
expected: `NAME POD/NODE-IPS
GroupName1 10.0.0.3,127.0.0.1,127.0.0.2,127.0.0.3 + 2 more...
GroupName2 <NONE>
`,
},
{
name: "StructureData-AddressGroup-HasNode",
rawResponseData: []addressgroup.Response{
{
Name: "AddressGroupNameHasNode",
Nodes: []common.GroupMember{
{IP: "127.0.0.1"}, {IP: "192.168.0.1"}, {IP: "10.176.27.105"}, {IP: "127.0.0.3"},
},
},
{
Name: "AddressGroupNameHasNode1",
Pods: []common.GroupMember{
{IP: "127.0.0.1"}, {IP: "192.168.0.1"}, {IP: "127.0.0.2"},
{IP: "127.0.0.3"}, {IP: "10.0.0.3"}, {IP: "127.0.0.5"}, {IP: "127.0.0.6"},
},
},
{
Name: "AddressGroupNameHasNode2",
Pods: []common.GroupMember{},
},
},
expected: `NAME POD/NODE-IPS
AddressGroupNameHasNode 10.176.27.105,127.0.0.1,127.0.0.3,192.168.0.1
AddressGroupNameHasNode1 10.0.0.3,127.0.0.1,127.0.0.2,127.0.0.3 + 2 more...
AddressGroupNameHasNode2 <NONE>
`,
},
{
Expand Down

0 comments on commit f8eaabb

Please sign in to comment.