diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2021-12-15 18:58:06 +0100 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2022-01-06 18:28:13 +0100 |
commit | 65b92a730a3e12dac6269de78f89c690ca5ffd73 (patch) | |
tree | 9414398c40e930d70885f9661ea13dd76776ae35 /integration/system | |
parent | 702cb7fe146b8423346195e7ae7d94a47224fb3d (diff) | |
download | docker-65b92a730a3e12dac6269de78f89c690ca5ffd73.tar.gz |
integration(-cli): remove discovery related tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'integration/system')
-rw-r--r-- | integration/system/info_linux_test.go | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/integration/system/info_linux_test.go b/integration/system/info_linux_test.go index 87e691f526..4b5cb5a051 100644 --- a/integration/system/info_linux_test.go +++ b/integration/system/info_linux_test.go @@ -5,16 +5,12 @@ package system // import "github.com/docker/docker/integration/system" import ( "context" - "fmt" - "net" "net/http" "testing" - "github.com/docker/docker/testutil/daemon" req "github.com/docker/docker/testutil/request" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" - "gotest.tools/v3/skip" ) func TestInfoBinaryCommits(t *testing.T) { @@ -48,72 +44,3 @@ func TestInfoAPIVersioned(t *testing.T) { assert.Check(t, is.Contains(out, "ExecutionDriver")) assert.Check(t, is.Contains(out, "not supported")) } - -// TestInfoDiscoveryBackend verifies that a daemon run with `--cluster-advertise` and -// `--cluster-store` properly returns the backend's endpoint in info output. -func TestInfoDiscoveryBackend(t *testing.T) { - skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon") - - const ( - discoveryBackend = "consul://consuladdr:consulport/some/path" - discoveryAdvertise = "1.1.1.1:2375" - ) - - d := daemon.New(t) - d.Start(t, "--cluster-store="+discoveryBackend, "--cluster-advertise="+discoveryAdvertise) - defer d.Stop(t) - - info := d.Info(t) - assert.Equal(t, info.ClusterStore, discoveryBackend) - assert.Equal(t, info.ClusterAdvertise, discoveryAdvertise) -} - -// TestInfoDiscoveryInvalidAdvertise verifies that a daemon run with -// an invalid `--cluster-advertise` configuration -func TestInfoDiscoveryInvalidAdvertise(t *testing.T) { - skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon") - d := daemon.New(t) - - // --cluster-advertise with an invalid string is an error - err := d.StartWithError("--cluster-store=consul://consuladdr:consulport/some/path", "--cluster-advertise=invalid") - if err == nil { - d.Stop(t) - } - assert.ErrorContains(t, err, "", "expected error when starting daemon") - - // --cluster-advertise without --cluster-store is also an error - err = d.StartWithError("--cluster-advertise=1.1.1.1:2375") - if err == nil { - d.Stop(t) - } - assert.ErrorContains(t, err, "", "expected error when starting daemon") -} - -// TestInfoDiscoveryAdvertiseInterfaceName verifies that a daemon run with `--cluster-advertise` -// configured with interface name properly show the advertise ip-address in info output. -func TestInfoDiscoveryAdvertiseInterfaceName(t *testing.T) { - skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon") - skip.If(t, testEnv.IsRootless, "rootless mode has different view of network") - // TODO should we check for networking availability (integration-cli suite checks for networking through `Network()`) - - d := daemon.New(t) - const ( - discoveryStore = "consul://consuladdr:consulport/some/path" - discoveryInterface = "eth0" - ) - - d.Start(t, "--cluster-store="+discoveryStore, fmt.Sprintf("--cluster-advertise=%s:2375", discoveryInterface)) - defer d.Stop(t) - - iface, err := net.InterfaceByName(discoveryInterface) - assert.NilError(t, err) - addrs, err := iface.Addrs() - assert.NilError(t, err) - assert.Assert(t, len(addrs) > 0) - ip, _, err := net.ParseCIDR(addrs[0].String()) - assert.NilError(t, err) - - info := d.Info(t) - assert.Equal(t, info.ClusterStore, discoveryStore) - assert.Equal(t, info.ClusterAdvertise, ip.String()+":2375") -} |