summaryrefslogtreecommitdiff
path: root/pkg/network/netconflist_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-16 13:36:47 +0200
committerGitHub <noreply@github.com>2020-08-16 13:36:47 +0200
commit96fb5dc94d88bc4eafe82382bfb26b64c479f76b (patch)
tree78a831b89f1a4581884a6d520fcd1c4799210d4e /pkg/network/netconflist_test.go
parentf1f1834f91c84b68f5c95dea68c9ecbbf60eb696 (diff)
parent07e3f1bba9674c0cb93a0fa260930bfebbf75728 (diff)
downloadpodman-96fb5dc94d88bc4eafe82382bfb26b64c479f76b.tar.gz
podman-96fb5dc94d88bc4eafe82382bfb26b64c479f76b.tar.bz2
podman-96fb5dc94d88bc4eafe82382bfb26b64c479f76b.zip
Merge pull request #7314 from aojea/ipv6_default_gw
IPv6 default route
Diffstat (limited to 'pkg/network/netconflist_test.go')
-rw-r--r--pkg/network/netconflist_test.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkg/network/netconflist_test.go b/pkg/network/netconflist_test.go
new file mode 100644
index 000000000..a82a0140a
--- /dev/null
+++ b/pkg/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 errorr expected: %v", err)
+ }
+ if !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NewIPAMDefaultRoute() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}