From 43b35706808018de569f990dae656edb791be260 Mon Sep 17 00:00:00 2001
From: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Date: Wed, 8 Feb 2023 18:07:41 +0900
Subject: [PATCH] e2e: fix some tests on remote

- podman-remote unshare returns an error message
  with the exit code '125'.

- Need to run RestartRemoteService() to apply
  changes to the TMPDIR.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
---
 test/e2e/containers_conf_test.go | 3 +++
 test/e2e/unshare_test.go         | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go
index 8f53a665ed..399824badd 100644
--- a/test/e2e/containers_conf_test.go
+++ b/test/e2e/containers_conf_test.go
@@ -426,6 +426,9 @@ var _ = Describe("Verify podman containers.conf usage", func() {
 		} else {
 			defer os.Unsetenv("TMPDIR")
 		}
+		if IsRemote() {
+			podmanTest.RestartRemoteService()
+		}
 
 		session := podmanTest.Podman([]string{"info", "--format", "{{.Store.ImageCopyTmpDir}}"})
 		session.WaitWithDefaultTimeout()
diff --git a/test/e2e/unshare_test.go b/test/e2e/unshare_test.go
index 166433faeb..731dfe3eef 100644
--- a/test/e2e/unshare_test.go
+++ b/test/e2e/unshare_test.go
@@ -94,7 +94,7 @@ var _ = Describe("Podman unshare", func() {
 		SkipIfNotRemote("check for podman-remote unshare error")
 		session := podmanTest.Podman([]string{"unshare"})
 		session.WaitWithDefaultTimeout()
-		Expect(session).Should(Exit(0))
-		Expect(session.OutputToString()).To(Equal(`Error: cannot use command "podman-remote unshare" with the remote podman client`))
+		Expect(session).Should(Exit(125))
+		Expect(session.ErrorToString()).To(Equal(`Error: cannot use command "podman-remote unshare" with the remote podman client`))
 	})
 })