github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/integration-cli/docker_cli_inspect_experimental_test.go (about)

     1  // +build experimental
     2  
     3  package main
     4  
     5  import (
     6  	"github.com/docker/docker/pkg/integration/checker"
     7  	"github.com/docker/engine-api/types"
     8  	"github.com/go-check/check"
     9  )
    10  
    11  func (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) {
    12  	testRequires(c, DaemonIsLinux)
    13  	dockerCmd(c, "run", "-d", "--name", "test", "-v", "data:/data", "busybox", "cat")
    14  
    15  	vol := inspectFieldJSON(c, "test", "Mounts")
    16  
    17  	var mp []types.MountPoint
    18  	err := unmarshalJSON([]byte(vol), &mp)
    19  	c.Assert(err, checker.IsNil)
    20  
    21  	c.Assert(mp, checker.HasLen, 1, check.Commentf("Expected 1 mount point"))
    22  
    23  	m := mp[0]
    24  	c.Assert(m.Name, checker.Equals, "data", check.Commentf("Expected name data"))
    25  
    26  	c.Assert(m.Driver, checker.Equals, "local", check.Commentf("Expected driver local"))
    27  
    28  	c.Assert(m.Source, checker.Not(checker.Equals), "", check.Commentf("Expected source to not be empty"))
    29  
    30  	c.Assert(m.RW, checker.Equals, true)
    31  
    32  	c.Assert(m.Destination, checker.Equals, "/data", check.Commentf("Expected destination /data"))
    33  }