"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "integration-cli/docker_cli_run_unix_test.go" between
moby-20.10.6.tar.gz and moby-20.10.7.tar.gz

About: Moby is a framework to assemble specialized container systems (formerly project name Docker; see here to clarify the relationship between the projects).

docker_cli_run_unix_test.go  (moby-20.10.6):docker_cli_run_unix_test.go  (moby-20.10.7)
skipping to change at line 498 skipping to change at line 498
out, _, err = dockerCmdWithError("run", "--cpu-period", "2000000", "busyb ox", "true") out, _, err = dockerCmdWithError("run", "--cpu-period", "2000000", "busyb ox", "true")
assert.ErrorContains(c, err, "") assert.ErrorContains(c, err, "")
assert.Assert(c, strings.Contains(out, expected)) assert.Assert(c, strings.Contains(out, expected))
out, _, err = dockerCmdWithError("run", "--cpu-period", "-3", "busybox", "true") out, _, err = dockerCmdWithError("run", "--cpu-period", "-3", "busybox", "true")
assert.ErrorContains(c, err, "") assert.ErrorContains(c, err, "")
assert.Assert(c, strings.Contains(out, expected)) assert.Assert(c, strings.Contains(out, expected))
} }
func (s *DockerSuite) TestRunWithKernelMemory(c *testing.T) {
testRequires(c, DaemonIsLinux, kernelMemorySupport)
file := "/sys/fs/cgroup/memory/memory.kmem.limit_in_bytes"
cli.DockerCmd(c, "run", "--kernel-memory", "50M", "--name", "test1", "bus
ybox", "cat", file).Assert(c, icmd.Expected{
Out: "52428800",
})
cli.InspectCmd(c, "test1", cli.Format(".HostConfig.KernelMemory")).Assert
(c, icmd.Expected{
Out: "52428800",
})
}
func (s *DockerSuite) TestRunWithInvalidKernelMemory(c *testing.T) {
testRequires(c, DaemonIsLinux, kernelMemorySupport)
out, _, err := dockerCmdWithError("run", "--kernel-memory", "2M", "busybo
x", "true")
assert.ErrorContains(c, err, "")
expected := "Minimum kernel memory limit allowed is 4MB"
assert.Assert(c, strings.Contains(out, expected))
out, _, err = dockerCmdWithError("run", "--kernel-memory", "-16m", "--nam
e", "test2", "busybox", "echo", "test")
assert.ErrorContains(c, err, "")
expected = "invalid size"
assert.Assert(c, strings.Contains(out, expected))
}
func (s *DockerSuite) TestRunWithCPUShares(c *testing.T) { func (s *DockerSuite) TestRunWithCPUShares(c *testing.T) {
testRequires(c, cpuShare) testRequires(c, cpuShare)
file := "/sys/fs/cgroup/cpu/cpu.shares" file := "/sys/fs/cgroup/cpu/cpu.shares"
out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "--name", "test", " busybox", "cat", file) out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "--name", "test", " busybox", "cat", file)
assert.Equal(c, strings.TrimSpace(out), "1000") assert.Equal(c, strings.TrimSpace(out), "1000")
out = inspectField(c, "test", "HostConfig.CPUShares") out = inspectField(c, "test", "HostConfig.CPUShares")
assert.Equal(c, out, "1000") assert.Equal(c, out, "1000")
} }
 End of changes. 1 change blocks. 
31 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)