From 9831668010e84902b0077e6766a426c7eeb62012 Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Tue, 19 Mar 2019 08:23:55 -0600 Subject: [PATCH] test: Add docker integration test for sysctls This will add a docker integration test for sysctls. Fixes #1312 Signed-off-by: Gabriela Cervantes --- integration/docker/sysctls_test.go | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 integration/docker/sysctls_test.go diff --git a/integration/docker/sysctls_test.go b/integration/docker/sysctls_test.go new file mode 100644 index 000000000..7d77261bb --- /dev/null +++ b/integration/docker/sysctls_test.go @@ -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)) + }) + }) +})