From ee146a9ab0721ec6fe2c6e3092928c34a9b3b6d7 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Wed, 3 Nov 2021 15:59:23 +0100 Subject: Refactor remote socket path determination in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate the code that determines the directory and file prefix from the code that chooses and applies a UUID; we will make the second part more complex in a bit. Should not change behavior. Signed-off-by: Miloslav Trmač --- test/e2e/common_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 6e1a62b99..456e2bab1 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -274,15 +274,15 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration { } if remote { - uuid := stringid.GenerateNonCryptoID() + var pathPrefix string if !rootless.IsRootless() { - p.RemoteSocket = fmt.Sprintf("unix:/run/podman/podman-%s.sock", uuid) + pathPrefix = "/run/podman/podman" } else { runtimeDir := os.Getenv("XDG_RUNTIME_DIR") - socket := fmt.Sprintf("podman-%s.sock", uuid) - fqpath := filepath.Join(runtimeDir, socket) - p.RemoteSocket = fmt.Sprintf("unix:%s", fqpath) + pathPrefix = filepath.Join(runtimeDir, "podman") } + uuid := stringid.GenerateNonCryptoID() + p.RemoteSocket = fmt.Sprintf("unix:%s-%s.sock", pathPrefix, uuid) } // Setup registries.conf ENV variable -- cgit v1.2.3-54-g00ecf