mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix TestCreateShrinkRootfs and TestCreateShrinkRootfs
Signed-off-by: mYmNeo <thomassong@tencent.com>
This commit is contained in:
parent
90f512427f
commit
ce87de21a7
1 changed files with 3 additions and 3 deletions
|
@ -68,15 +68,15 @@ func (s *DockerSuite) TestCreateGrowRootfs(c *check.C) {
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
|
|
||||||
inspectOut := inspectField(c, cleanedContainerID, "HostConfig.StorageOpt")
|
inspectOut := inspectField(c, cleanedContainerID, "HostConfig.StorageOpt")
|
||||||
c.Assert(inspectOut, checker.Equals, "[size=120G]")
|
c.Assert(inspectOut, checker.Equals, "map[size:120G]")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we cannot shrink the container's rootfs at creation time.
|
// Make sure we cannot shrink the container's rootfs at creation time.
|
||||||
func (s *DockerSuite) TestCreateShrinkRootfs(c *check.C) {
|
func (s *DockerSuite) TestCreateShrinkRootfs(c *check.C) {
|
||||||
testRequires(c, Devicemapper)
|
testRequires(c, Devicemapper)
|
||||||
|
|
||||||
// Ensure this fails
|
// Ensure this fails because of the defaultBaseFsSize is 10G
|
||||||
out, _, err := dockerCmdWithError("create", "--storage-opt", "size=80G", "busybox")
|
out, _, err := dockerCmdWithError("create", "--storage-opt", "size=5G", "busybox")
|
||||||
c.Assert(err, check.NotNil, check.Commentf(out))
|
c.Assert(err, check.NotNil, check.Commentf(out))
|
||||||
c.Assert(out, checker.Contains, "Container size cannot be smaller than")
|
c.Assert(out, checker.Contains, "Container size cannot be smaller than")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue