mirror of
https://github.com/containers/podman.git
synced 2025-12-16 03:57:36 +08:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user