mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
Merge pull request #51574 from 2003Aditya/TestAPINetworkInspectWithScope
migrate TestAPINetworkInspectWithScope to integration test
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
"github.com/cloudflare/cfssl/csr"
|
||||
"github.com/cloudflare/cfssl/helpers"
|
||||
"github.com/cloudflare/cfssl/initca"
|
||||
cerrdefs "github.com/containerd/errdefs"
|
||||
"github.com/moby/moby/api/types/container"
|
||||
"github.com/moby/moby/api/types/swarm"
|
||||
"github.com/moby/moby/client"
|
||||
@@ -1019,22 +1018,3 @@ func (s *DockerSwarmSuite) TestSwarmRepeatedRootRotation(c *testing.T) {
|
||||
currentTrustRoot = clusterTLSInfo.TrustRoot
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSwarmSuite) TestAPINetworkInspectWithScope(c *testing.T) {
|
||||
ctx := testutil.GetContext(c)
|
||||
d := s.AddDaemon(ctx, c, true, true)
|
||||
|
||||
name := "test-scoped-network"
|
||||
apiclient := d.NewClientT(c)
|
||||
|
||||
create, err := apiclient.NetworkCreate(ctx, name, client.NetworkCreateOptions{Driver: "overlay"})
|
||||
assert.NilError(c, err)
|
||||
|
||||
inspect, err := apiclient.NetworkInspect(ctx, name, client.NetworkInspectOptions{})
|
||||
assert.NilError(c, err)
|
||||
assert.Check(c, is.Equal("swarm", inspect.Network.Scope))
|
||||
assert.Check(c, is.Equal(create.ID, inspect.Network.ID))
|
||||
|
||||
_, err = apiclient.NetworkInspect(ctx, name, client.NetworkInspectOptions{Scope: "local"})
|
||||
assert.Check(c, is.ErrorType(err, cerrdefs.IsNotFound))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user