From 2ba3b58b471e689628fef8df11143f9ff231c1ef Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Tue, 12 Jun 2018 14:31:01 -0400 Subject: [PATCH 1/2] refactored network integration tests under integration/network/service_test.go to use network package Signed-off-by: Arash Deshmeh Upstream-commit: 694047183a9f72b3b2b45ef09f27dc0776fa3e10 Component: engine --- .../integration/network/service_test.go | 55 +++++++------------ 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/components/engine/integration/network/service_test.go b/components/engine/integration/network/service_test.go index 77ef870911..dc6fc068a0 100644 --- a/components/engine/integration/network/service_test.go +++ b/components/engine/integration/network/service_test.go @@ -9,6 +9,7 @@ import ( swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" + "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/internal/test/daemon" "github.com/gotestyourself/gotestyourself/assert" @@ -66,24 +67,18 @@ func TestDaemonDefaultNetworkPools(t *testing.T) { // Create a bridge network and verify its subnet is the second default pool name := "elango" - networkCreate := types.NetworkCreate{ - CheckDuplicate: false, - } - networkCreate.Driver = "bridge" - _, err = cli.NetworkCreate(context.Background(), name, networkCreate) - assert.NilError(t, err) + network.CreateNoError(t, context.Background(), cli, name, + network.WithDriver("bridge"), + ) out, err = cli.NetworkInspect(context.Background(), name, types.NetworkInspectOptions{}) assert.NilError(t, err) assert.Equal(t, out.IPAM.Config[0].Subnet, "175.33.0.0/24") // Create a bridge network and verify its subnet is the third default pool name = "saanvi" - networkCreate = types.NetworkCreate{ - CheckDuplicate: false, - } - networkCreate.Driver = "bridge" - _, err = cli.NetworkCreate(context.Background(), name, networkCreate) - assert.NilError(t, err) + network.CreateNoError(t, context.Background(), cli, name, + network.WithDriver("bridge"), + ) out, err = cli.NetworkInspect(context.Background(), name, types.NetworkInspectOptions{}) assert.NilError(t, err) assert.Equal(t, out.IPAM.Config[0].Subnet, "175.33.1.0/24") @@ -105,12 +100,9 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) { // Create a bridge network name := "elango" - networkCreate := types.NetworkCreate{ - CheckDuplicate: false, - } - networkCreate.Driver = "bridge" - _, err = cli.NetworkCreate(context.Background(), name, networkCreate) - assert.NilError(t, err) + network.CreateNoError(t, context.Background(), cli, name, + network.WithDriver("bridge"), + ) out, err := cli.NetworkInspect(context.Background(), name, types.NetworkInspectOptions{}) assert.NilError(t, err) networkip := out.IPAM.Config[0].Subnet @@ -140,24 +132,18 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) { // Create a bridge network name := "elango" - networkCreate := types.NetworkCreate{ - CheckDuplicate: false, - } - networkCreate.Driver = "bridge" - _, err = cli.NetworkCreate(context.Background(), name, networkCreate) - assert.NilError(t, err) + network.CreateNoError(t, context.Background(), cli, name, + network.WithDriver("bridge"), + ) out, err := cli.NetworkInspect(context.Background(), name, types.NetworkInspectOptions{}) assert.NilError(t, err) networkip := out.IPAM.Config[0].Subnet // Create a bridge network name = "sthira" - networkCreate = types.NetworkCreate{ - CheckDuplicate: false, - } - networkCreate.Driver = "bridge" - _, err = cli.NetworkCreate(context.Background(), name, networkCreate) - assert.NilError(t, err) + network.CreateNoError(t, context.Background(), cli, name, + network.WithDriver("bridge"), + ) out, err = cli.NetworkInspect(context.Background(), name, types.NetworkInspectOptions{}) assert.NilError(t, err) networkip2 := out.IPAM.Config[0].Subnet @@ -169,12 +155,9 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) { // Create a bridge network name = "saanvi" - networkCreate = types.NetworkCreate{ - CheckDuplicate: false, - } - networkCreate.Driver = "bridge" - _, err = cli.NetworkCreate(context.Background(), name, networkCreate) - assert.NilError(t, err) + network.CreateNoError(t, context.Background(), cli, name, + network.WithDriver("bridge"), + ) out1, err := cli.NetworkInspect(context.Background(), name, types.NetworkInspectOptions{}) assert.NilError(t, err) From 2e5e9bbe357b56c87acb13abc45af3150fc88629 Mon Sep 17 00:00:00 2001 From: Yuichiro Kaneko Date: Wed, 13 Jun 2018 21:58:32 +0900 Subject: [PATCH 2/2] Fix link anchors in CONTRIBUTING.md This is a follow up of #35168. Signed-off-by: Yuichiro Kaneko Upstream-commit: 7b3966245de27b753c6acfe0347833811ed9eed8 Component: engine --- components/engine/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/engine/CONTRIBUTING.md b/components/engine/CONTRIBUTING.md index c45ae3376b..daefdadaed 100644 --- a/components/engine/CONTRIBUTING.md +++ b/components/engine/CONTRIBUTING.md @@ -8,7 +8,7 @@ process](docs/contributing/). This page contains information about reporting issues as well as some tips and guidelines useful to experienced open source contributors. Finally, make sure -you read our [community guidelines](#docker-community-guidelines) before you +you read our [community guidelines](#moby-community-guidelines) before you start participating. ## Topics @@ -17,7 +17,7 @@ start participating. * [Design and Cleanup Proposals](#design-and-cleanup-proposals) * [Reporting Issues](#reporting-other-issues) * [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines) -* [Community Guidelines](#docker-community-guidelines) +* [Community Guidelines](#moby-community-guidelines) ## Reporting security issues