diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 4a70cbe2e9..0f14b2985c 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -268,7 +268,7 @@ var _ = Describe("Podman kube generate", func() { It("podman generate kube on pod with user namespace", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index 156546b129..e058fea7a3 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -682,7 +682,7 @@ ENTRYPOINT ["sleep","99999"] Expect(session).Should(Exit(0)) u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - Expect(session.OutputToString()).To(ContainSubstring(u.Name)) + Expect(session.OutputToString()).To(Equal(u.Username)) // root owns /usr session = podmanTest.Podman([]string{"run", "--pod", podName, ALPINE, "stat", "-c%u", "/usr"}) @@ -715,10 +715,10 @@ ENTRYPOINT ["sleep","99999"] Expect(err).ToNot(HaveOccurred()) // container inside pod inherits user from infra container if --user is not set // etc/passwd entry will look like USERNAME:*:1000:1000:Full User Name:/:/bin/sh - exec1 := podmanTest.Podman([]string{"exec", ctrName, "cat", "/etc/passwd"}) + exec1 := podmanTest.Podman([]string{"exec", ctrName, "id", "-un"}) exec1.WaitWithDefaultTimeout() Expect(exec1).Should(Exit(0)) - Expect(exec1.OutputToString()).To(ContainSubstring(u.Name)) + Expect(exec1.OutputToString()).To(Equal(u.Username)) exec2 := podmanTest.Podman([]string{"exec", ctrName, "useradd", "testuser"}) exec2.WaitWithDefaultTimeout() @@ -733,7 +733,7 @@ ENTRYPOINT ["sleep","99999"] It("podman pod create with --userns=auto", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -768,7 +768,7 @@ ENTRYPOINT ["sleep","99999"] u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -804,7 +804,7 @@ ENTRYPOINT ["sleep","99999"] u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -841,7 +841,7 @@ ENTRYPOINT ["sleep","99999"] u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go index da58f6d206..269b4895e4 100644 --- a/test/e2e/run_userns_test.go +++ b/test/e2e/run_userns_test.go @@ -64,7 +64,7 @@ var _ = Describe("Podman UserNS support", func() { It("podman build with --userns=auto", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -157,7 +157,7 @@ var _ = Describe("Podman UserNS support", func() { Expect(session).Should(Exit(0)) u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - Expect(session.OutputToString()).To(ContainSubstring(u.Name)) + Expect(session.OutputToString()).To(Equal(u.Username)) }) It("podman --userns=keep-id root owns /usr", func() { @@ -201,7 +201,7 @@ var _ = Describe("Podman UserNS support", func() { It("podman --userns=auto", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -239,7 +239,7 @@ var _ = Describe("Podman UserNS support", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -277,7 +277,7 @@ var _ = Describe("Podman UserNS support", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" } @@ -306,7 +306,7 @@ var _ = Describe("Podman UserNS support", func() { u, err := user.Current() Expect(err).ToNot(HaveOccurred()) - name := u.Name + name := u.Username if name == "root" { name = "containers" }