mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #25370 from thaJeztah/move-experimental-test
Move TestInspectNamedMountPoint integrationtest from experimental
This commit is contained in:
commit
af51c9704c
2 changed files with 23 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
|||
// +build experimental
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/docker/engine-api/types"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
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"))
|
||||
}
|
|
@ -245,6 +245,29 @@ func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) {
|
|||
c.Assert(m.RW, checker.Equals, false)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) {
|
||||
prefix, slash := getPrefixAndSlashFromDaemonPlatform()
|
||||
|
||||
dockerCmd(c, "run", "-d", "--name", "test", "-v", "data:"+prefix+slash+"data", "busybox", "cat")
|
||||
|
||||
vol := inspectFieldJSON(c, "test", "Mounts")
|
||||
|
||||
var mp []types.MountPoint
|
||||
err := unmarshalJSON([]byte(vol), &mp)
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
// check that there is only one mountpoint
|
||||
c.Assert(mp, checker.HasLen, 1)
|
||||
|
||||
m := mp[0]
|
||||
|
||||
c.Assert(m.Name, checker.Equals, "data")
|
||||
c.Assert(m.Driver, checker.Equals, "local")
|
||||
c.Assert(m.Source, checker.Not(checker.Equals), "")
|
||||
c.Assert(m.Destination, checker.Equals, prefix+slash+"data")
|
||||
c.Assert(m.RW, checker.Equals, true)
|
||||
}
|
||||
|
||||
// #14947
|
||||
func (s *DockerSuite) TestInspectTimesAsRFC3339Nano(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
|
|
Loading…
Add table
Reference in a new issue