test/e2e: do not call setenforce

We should not change selinux, in a parallel context this can change the
behavior of other tests and we should never disable selinux anyway.

Lets see if this passes CI or not.

Fixes #18564

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-05-17 17:24:40 +02:00
parent ac2d0db47d
commit a54d4d7e1e
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"})