mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add format flag to network inspect
…for consistency as docker inspect and docker volume inspect supports it too Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
a600bf4eab
commit
295c27388d
6 changed files with 78 additions and 9 deletions
|
@ -293,6 +293,17 @@ func (s *DockerSuite) TestDockerNetworkDeleteMultiple(c *check.C) {
|
|||
assertNwIsAvailable(c, "testDelMulti2")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkInspect(c *check.C) {
|
||||
out, _ := dockerCmd(c, "network", "inspect", "host")
|
||||
networkResources := []types.NetworkResource{}
|
||||
err := json.Unmarshal([]byte(out), &networkResources)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(networkResources, checker.HasLen, 1)
|
||||
|
||||
out, _ = dockerCmd(c, "network", "inspect", "--format='{{ .Name }}'", "host")
|
||||
c.Assert(strings.TrimSpace(out), check.Equals, "host")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestDockerInspectMultipleNetwork(c *check.C) {
|
||||
out, _ := dockerCmd(c, "network", "inspect", "host", "none")
|
||||
networkResources := []types.NetworkResource{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue