1
0
mirror of https://github.com/moby/moby.git synced 2025-12-06 07:41:18 +03:00

Fix cfs period calculation

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2016-11-17 16:39:47 -08:00
parent 4b29f404b1
commit aff99136b4
2 changed files with 2 additions and 5 deletions

View File

@@ -1577,7 +1577,7 @@ func (s *DockerSuite) TestRunWithNanoCPUs(c *check.C) {
file1 := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
file2 := "/sys/fs/cgroup/cpu/cpu.cfs_period_us"
out, _ := dockerCmd(c, "run", "--cpus", "0.5", "--name", "test", "busybox", "sh", "-c", fmt.Sprintf("cat %s && cat %s", file1, file2))
c.Assert(strings.TrimSpace(out), checker.Equals, "500000\n1000000")
c.Assert(strings.TrimSpace(out), checker.Equals, "50000\n100000")
out = inspectField(c, "test", "HostConfig.NanoCpus")
c.Assert(out, checker.Equals, "5e+08", check.Commentf("setting the Nano CPUs failed"))