fix TestCreateShrinkRootfs and TestCreateShrinkRootfs
Signed-off-by: mYmNeo <thomassong@tencent.com> Upstream-commit: ce87de21a7594f5d49987a7333f1f0e77984f117 Component: engine
This commit is contained in:
@ -68,15 +68,15 @@ func (s *DockerSuite) TestCreateGrowRootfs(c *check.C) {
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
|
||||
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.
|
||||
func (s *DockerSuite) TestCreateShrinkRootfs(c *check.C) {
|
||||
testRequires(c, Devicemapper)
|
||||
|
||||
// Ensure this fails
|
||||
out, _, err := dockerCmdWithError("create", "--storage-opt", "size=80G", "busybox")
|
||||
// Ensure this fails because of the defaultBaseFsSize is 10G
|
||||
out, _, err := dockerCmdWithError("create", "--storage-opt", "size=5G", "busybox")
|
||||
c.Assert(err, check.NotNil, check.Commentf(out))
|
||||
c.Assert(out, checker.Contains, "Container size cannot be smaller than")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user