mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #77 from fmzhen/test-dev
Add TestSandboxInfoEqual in sandbox_test.go
This commit is contained in:
commit
0d57047ef8
1 changed files with 17 additions and 0 deletions
|
@ -39,6 +39,23 @@ func TestInterfaceEqual(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSandboxInfoEqual(t *testing.T) {
|
||||||
|
si1 := &Info{Interfaces: getInterfaceList(), Gateway: net.ParseIP("192.168.1.254"), GatewayIPv6: net.ParseIP("2001:2345::abcd:8889")}
|
||||||
|
si2 := &Info{Interfaces: getInterfaceList(), Gateway: net.ParseIP("172.18.255.254"), GatewayIPv6: net.ParseIP("2001:2345::abcd:8888")}
|
||||||
|
|
||||||
|
if !si1.Equal(si1) {
|
||||||
|
t.Fatalf("Info.Equal() returned false negative")
|
||||||
|
}
|
||||||
|
|
||||||
|
if si1.Equal(si2) {
|
||||||
|
t.Fatalf("Info.Equal() returned false positive")
|
||||||
|
}
|
||||||
|
|
||||||
|
if si1.Equal(si2) != si2.Equal(si1) {
|
||||||
|
t.Fatalf("Info.Equal() failed commutative check")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestInterfaceCopy(t *testing.T) {
|
func TestInterfaceCopy(t *testing.T) {
|
||||||
for _, iface := range getInterfaceList() {
|
for _, iface := range getInterfaceList() {
|
||||||
cp := iface.GetCopy()
|
cp := iface.GetCopy()
|
||||||
|
|
Loading…
Add table
Reference in a new issue