Merge pull request #18607 from Luap99/e2e-no-setenforce

test/e2e: do not call setenforce
This commit is contained in:
OpenShift Merge Robot
2023-05-17 13:32:52 -04:00
committed by GitHub
2 changed files with 1 additions and 27 deletions

View File

@ -26,24 +26,10 @@ var _ = Describe("Podman login and logout", func() {
)
BeforeEach(func() {
authPath = filepath.Join(podmanTest.TempDir, "auth")
err := os.Mkdir(authPath, os.ModePerm)
Expect(err).ToNot(HaveOccurred())
if IsCommandAvailable("getenforce") {
ge := SystemExec("getenforce", []string{})
ge.WaitWithDefaultTimeout()
if ge.OutputToString() == "Enforcing" {
se := SystemExec("setenforce", []string{"0"})
se.WaitWithDefaultTimeout()
if se.ExitCode() != 0 {
Skip("Cannot disable selinux, this may cause problem for reading cert files inside container.")
}
defer SystemExec("setenforce", []string{"1"})
}
}
htpasswd := SystemExec("htpasswd", []string{"-Bbn", "podmantest", "test"})
htpasswd.WaitWithDefaultTimeout()
Expect(htpasswd).Should(Exit(0))

View File

@ -209,7 +209,7 @@ var _ = Describe("Podman push", func() {
})
It("podman push to local registry with authorization", func() {
SkipIfRootless("volume-mounting a certs.d file N/A over remote")
SkipIfRootless("/etc/containers/certs.d not writable")
if podmanTest.Host.Arch == "ppc64le" {
Skip("No registry image for ppc64le")
}
@ -223,18 +223,6 @@ var _ = Describe("Podman push", func() {
cwd, _ := os.Getwd()
certPath := filepath.Join(cwd, "../", "certs")
if IsCommandAvailable("getenforce") {
ge := SystemExec("getenforce", []string{})
Expect(ge).Should(Exit(0))
if ge.OutputToString() == "Enforcing" {
se := SystemExec("setenforce", []string{"0"})
Expect(se).Should(Exit(0))
defer func() {
se2 := SystemExec("setenforce", []string{"1"})
Expect(se2).Should(Exit(0))
}()
}
}
lock := GetPortLock("5000")
defer lock.Unlock()
htpasswd := SystemExec("htpasswd", []string{"-Bbn", "podmantest", "test"})