forked from kata-containers/tests
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add docker integration test for sysctls
This will add a docker integration test for sysctls. Fixes kata-containers#1312 Signed-off-by: Gabriela Cervantes <[email protected]>
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2019 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package docker | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("sysctls", func() { | ||
var ( | ||
args []string | ||
id string | ||
stdout string | ||
exitCode int | ||
) | ||
|
||
BeforeEach(func() { | ||
id = randomDockerName() | ||
}) | ||
|
||
AfterEach(func() { | ||
Expect(ExistDockerContainer(id)).NotTo(BeTrue()) | ||
}) | ||
|
||
Context("sysctls for fs", func() { | ||
It("should be applied", func() { | ||
fsValue := "512" | ||
args = []string{"--name", id, "--rm", "--sysctl", "fs.mqueue.queues_max=" + fsValue, Image, "cat", "/proc/sys/fs/mqueue/queues_max"} | ||
stdout, _, exitCode = dockerRun(args...) | ||
Expect(exitCode).To(Equal(0)) | ||
Expect(stdout).To(ContainSubstring(fsValue)) | ||
}) | ||
}) | ||
}) |