mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
e2e: fix play_kube_test
When SELinux is enabled, e2e test could be failed due to run a ls command in a running container. Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
This commit is contained in:
@ -3157,12 +3157,18 @@ spec:
|
|||||||
hostPathDir := filepath.Join(tempdir, testdir)
|
hostPathDir := filepath.Join(tempdir, testdir)
|
||||||
err := os.Mkdir(hostPathDir, 0755)
|
err := os.Mkdir(hostPathDir, 0755)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
defer os.RemoveAll(hostPathDir)
|
||||||
|
|
||||||
hostPathDirFile := filepath.Join(hostPathDir, testfile)
|
hostPathDirFile := filepath.Join(hostPathDir, testfile)
|
||||||
f, err := os.Create(hostPathDirFile)
|
f, err := os.Create(hostPathDirFile)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
|
if selinux.GetEnabled() {
|
||||||
|
label := SystemExec("chcon", []string{"-t", "container_file_t", hostPathDirFile})
|
||||||
|
Expect(label).Should(Exit(0))
|
||||||
|
}
|
||||||
|
|
||||||
// Create container image with named volume
|
// Create container image with named volume
|
||||||
containerfile := fmt.Sprintf(`
|
containerfile := fmt.Sprintf(`
|
||||||
FROM %s
|
FROM %s
|
||||||
|
Reference in New Issue
Block a user