diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-07 13:56:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-07 13:56:56 -0400 |
commit | 9ae873e60e149677db66782eaf2b4ed1402e97d2 (patch) | |
tree | 1f72e0558316390e8a235edad0f2464725dbd9c9 /libpod/network/netconflist_test.go | |
parent | 173e3c2faa74e5ef1b941338c06e5dd7dca68ac2 (diff) | |
parent | fe3faa517e1bbc3b2e82afaae32d8712c844fdae (diff) | |
download | podman-9ae873e60e149677db66782eaf2b4ed1402e97d2.tar.gz podman-9ae873e60e149677db66782eaf2b4ed1402e97d2.tar.bz2 podman-9ae873e60e149677db66782eaf2b4ed1402e97d2.zip |
Merge pull request #7943 from baude/issue7807
prevent unpredictable results with network create|remove
Diffstat (limited to 'libpod/network/netconflist_test.go')
-rw-r--r-- | libpod/network/netconflist_test.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libpod/network/netconflist_test.go b/libpod/network/netconflist_test.go new file mode 100644 index 000000000..5893bf985 --- /dev/null +++ b/libpod/network/netconflist_test.go @@ -0,0 +1,38 @@ +package network + +import ( + "reflect" + "testing" +) + +func TestNewIPAMDefaultRoute(t *testing.T) { + + tests := []struct { + name string + isIPv6 bool + want IPAMRoute + }{ + { + name: "IPv4 default route", + isIPv6: false, + want: IPAMRoute{defaultIPv4Route}, + }, + { + name: "IPv6 default route", + isIPv6: true, + want: IPAMRoute{defaultIPv6Route}, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + got, err := NewIPAMDefaultRoute(tt.isIPv6) + if err != nil { + t.Errorf("no error expected: %v", err) + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewIPAMDefaultRoute() = %v, want %v", got, tt.want) + } + }) + } +} |