|
@@ -123,7 +123,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTarget(c *check.C) {
|
|
|
|
|
|
func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
|
|
d := s.AddDaemon(c, true, true)
|
|
|
- out, err := d.Cmd("service", "create", "--mount", "type=tmpfs,target=/foo", "busybox", "sh", "-c", "mount | grep foo; tail -f /dev/null")
|
|
|
+ out, err := d.Cmd("service", "create", "--mount", "type=tmpfs,target=/foo,tmpfs-size=1MB", "busybox", "sh", "-c", "mount | grep foo; tail -f /dev/null")
|
|
|
c.Assert(err, checker.IsNil, check.Commentf(out))
|
|
|
id := strings.TrimSpace(out)
|
|
|
|
|
@@ -152,6 +152,8 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
|
|
c.Assert(mountConfig[0].Source, checker.Equals, "")
|
|
|
c.Assert(mountConfig[0].Target, checker.Equals, "/foo")
|
|
|
c.Assert(mountConfig[0].Type, checker.Equals, mount.TypeTmpfs)
|
|
|
+ c.Assert(mountConfig[0].TmpfsOptions, checker.NotNil)
|
|
|
+ c.Assert(mountConfig[0].TmpfsOptions.SizeBytes, checker.Equals, int64(1048576))
|
|
|
|
|
|
// check container mounts actual
|
|
|
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
|
|
@@ -169,4 +171,5 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
|
|
out, err = s.nodeCmd(c, task.NodeID, "logs", task.Status.ContainerStatus.ContainerID)
|
|
|
c.Assert(err, checker.IsNil, check.Commentf(out))
|
|
|
c.Assert(strings.TrimSpace(out), checker.HasPrefix, "tmpfs on /foo type tmpfs")
|
|
|
+ c.Assert(strings.TrimSpace(out), checker.Contains, "size=1024k")
|
|
|
}
|