|
@@ -8,6 +8,7 @@ import (
|
|
"testing"
|
|
"testing"
|
|
|
|
|
|
"github.com/docker/docker/libnetwork/netlabel"
|
|
"github.com/docker/docker/libnetwork/netlabel"
|
|
|
|
+ "github.com/docker/docker/libnetwork/ns"
|
|
"github.com/docker/docker/libnetwork/testutils"
|
|
"github.com/docker/docker/libnetwork/testutils"
|
|
"github.com/docker/docker/libnetwork/types"
|
|
"github.com/docker/docker/libnetwork/types"
|
|
"github.com/docker/docker/pkg/reexec"
|
|
"github.com/docker/docker/pkg/reexec"
|
|
@@ -101,6 +102,10 @@ func TestPortMappingConfig(t *testing.T) {
|
|
|
|
|
|
func TestPortMappingV6Config(t *testing.T) {
|
|
func TestPortMappingV6Config(t *testing.T) {
|
|
defer testutils.SetupTestOSContext(t)()
|
|
defer testutils.SetupTestOSContext(t)()
|
|
|
|
+ if err := loopbackUp(); err != nil {
|
|
|
|
+ t.Fatalf("Could not bring loopback iface up: %v", err)
|
|
|
|
+ }
|
|
|
|
+
|
|
d := newDriver()
|
|
d := newDriver()
|
|
|
|
|
|
config := &configuration{
|
|
config := &configuration{
|
|
@@ -169,3 +174,12 @@ func TestPortMappingV6Config(t *testing.T) {
|
|
t.Fatal(err)
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func loopbackUp() error {
|
|
|
|
+ nlHandle := ns.NlHandle()
|
|
|
|
+ iface, err := nlHandle.LinkByName("lo")
|
|
|
|
+ if err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ return nlHandle.LinkSetUp(iface)
|
|
|
|
+}
|