Skip to content

Commit

Permalink
Add test for cpu_cfs_period
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Valeriani committed Jul 16, 2018
1 parent 7fefd2b commit a4771a4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions client/driver/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2524,3 +2524,25 @@ func TestDockerImageRef(t *testing.T) {
})
}
}

func TestDockerDriver_CPUCFSPeriod(t *testing.T) {
if !tu.IsTravis() {
t.Parallel()
}
if !testutil.DockerIsConnected(t) {
t.Skip("Docker not connected")
}

task, _, _ := dockerTask(t)
task.Config["cpu_hard_limit"] = true
task.Config["cpu_cfs_period"] = 1000000

client, handle, cleanup := dockerSetup(t, task)
defer cleanup()

waitForExist(t, client, handle)

container, err := client.InspectContainer(handle.ContainerID())
assert.Nil(t, err, "Error inspecting container: %v", err)
assert.Equal(t, int64(1000000), container.HostConfig.CPUPeriod, "cpu_cfs_period option incorrectly set")
}

0 comments on commit a4771a4

Please sign in to comment.