summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2021-11-03 15:59:23 +0100
committerMiloslav Trmač <mitr@redhat.com>2022-01-03 12:31:47 +0100
commitee146a9ab0721ec6fe2c6e3092928c34a9b3b6d7 (patch)
tree498d18fd825c93946a7bb0dc3a96177410c8f23a
parent172d4eb40031a11d50c8198a569604f4bc915550 (diff)
downloadpodman-ee146a9ab0721ec6fe2c6e3092928c34a9b3b6d7.tar.gz
podman-ee146a9ab0721ec6fe2c6e3092928c34a9b3b6d7.tar.bz2
podman-ee146a9ab0721ec6fe2c6e3092928c34a9b3b6d7.zip
Refactor remote socket path determination in tests
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č <mitr@redhat.com>
-rw-r--r--test/e2e/common_test.go10
1 files changed, 5 insertions, 5 deletions
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