diff options
author | Pablo Correa Gómez <ablocorrea@hotmail.com> | 2021-04-28 15:19:19 +0200 |
---|---|---|
committer | Pablo Correa Gómez <ablocorrea@hotmail.com> | 2021-04-28 15:19:48 +0200 |
commit | 18cb17ffeb33195879730b2bc83e1a2c82310e6a (patch) | |
tree | 51a1d399ad0e97bf16d02a387841ee863ba8072d /test/e2e | |
parent | 4ca34fce08ffa9e29d0719e3e29383e9ffdb1572 (diff) | |
download | podman-18cb17ffeb33195879730b2bc83e1a2c82310e6a.tar.gz podman-18cb17ffeb33195879730b2bc83e1a2c82310e6a.tar.bz2 podman-18cb17ffeb33195879730b2bc83e1a2c82310e6a.zip |
Use seccomp_profile as default profile if defined in containers.conf
Edits `podman info` to provide the default seccomp profile
detected in the output
Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/containers_conf_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go index 803124de1..a354de3b2 100644 --- a/test/e2e/containers_conf_test.go +++ b/test/e2e/containers_conf_test.go @@ -353,4 +353,23 @@ var _ = Describe("Podman run", func() { Expect(session.ExitCode()).To(Equal(0)) Expect(session.OutputToString()).To(ContainSubstring("test")) }) + + It("podman info seccomp profile path", func() { + configPath := filepath.Join(podmanTest.TempDir, "containers.conf") + os.Setenv("CONTAINERS_CONF", configPath) + + profile := filepath.Join(podmanTest.TempDir, "seccomp.json") + containersConf := []byte(fmt.Sprintf("[containers]\nseccomp_profile=\"%s\"", profile)) + err = ioutil.WriteFile(configPath, containersConf, os.ModePerm) + Expect(err).To(BeNil()) + + if IsRemote() { + podmanTest.RestartRemoteService() + } + + session := podmanTest.Podman([]string{"info", "--format", "{{.Host.Security.SECCOMPProfilePath}}"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(Equal(profile)) + }) }) |