File: docker_cli_inspect_experimental_test.go

package info (click to toggle)
docker.io 1.11.2~ds1-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 23,652 kB
  • ctags: 12,672
  • sloc: sh: 7,238; makefile: 340; ansic: 123; xml: 62
file content (33 lines) | stat: -rw-r--r-- 983 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// +build experimental

package main

import (
	"github.com/docker/docker/pkg/integration/checker"
	"github.com/docker/engine-api/types"
	"gopkg.in/check.v1"
)

func (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) {
	testRequires(c, DaemonIsLinux)
	dockerCmd(c, "run", "-d", "--name", "test", "-v", "data:/data", "busybox", "cat")

	vol := inspectFieldJSON(c, "test", "Mounts")

	var mp []types.MountPoint
	err := unmarshalJSON([]byte(vol), &mp)
	c.Assert(err, checker.IsNil)

	c.Assert(mp, checker.HasLen, 1, check.Commentf("Expected 1 mount point"))

	m := mp[0]
	c.Assert(m.Name, checker.Equals, "data", check.Commentf("Expected name data"))

	c.Assert(m.Driver, checker.Equals, "local", check.Commentf("Expected driver local"))

	c.Assert(m.Source, checker.Not(checker.Equals), "", check.Commentf("Expected source to not be empty"))

	c.Assert(m.RW, checker.Equals, true)

	c.Assert(m.Destination, checker.Equals, "/data", check.Commentf("Expected destination /data"))
}