github.com/skatsuta/docker@v1.8.1/integration-cli/docker_cli_inspect_experimental_test.go (about) 1 // +build experimental 2 3 package main 4 5 import ( 6 "github.com/docker/docker/api/types" 7 "github.com/go-check/check" 8 ) 9 10 func (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) { 11 dockerCmd(c, "run", "-d", "--name", "test", "-v", "data:/data", "busybox", "cat") 12 13 vol, err := inspectFieldJSON("test", "Mounts") 14 c.Assert(err, check.IsNil) 15 16 var mp []types.MountPoint 17 err = unmarshalJSON([]byte(vol), &mp) 18 c.Assert(err, check.IsNil) 19 20 if len(mp) != 1 { 21 c.Fatalf("Expected 1 mount point, was %v\n", len(mp)) 22 } 23 24 m := mp[0] 25 if m.Name != "data" { 26 c.Fatalf("Expected name data, was %s\n", m.Name) 27 } 28 29 if m.Driver != "local" { 30 c.Fatalf("Expected driver local, was %s\n", m.Driver) 31 } 32 33 if m.Source == "" { 34 c.Fatalf("Expected source to not be empty") 35 } 36 37 if m.RW != true { 38 c.Fatalf("Expected rw to be true") 39 } 40 41 if m.Destination != "/data" { 42 c.Fatalf("Expected destination /data, was %s\n", m.Destination) 43 } 44 }