summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-04-08 14:47:31 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-04-08 22:16:55 +0200
commitae10f55362d1dfeacec2d10add1dffbceb0a31b9 (patch)
tree2407407b156ce3830c76f21177ff0ac3e07e3d76
parent6b9c1e28579050a5027adb5189f282fbac0e08c4 (diff)
downloadpodman-ae10f55362d1dfeacec2d10add1dffbceb0a31b9.tar.gz
podman-ae10f55362d1dfeacec2d10add1dffbceb0a31b9.tar.bz2
podman-ae10f55362d1dfeacec2d10add1dffbceb0a31b9.zip
test: fix remote tests for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rwxr-xr-xcontrib/cirrus/rootless_test.sh2
-rw-r--r--test/e2e/libpod_suite_remoteclient_test.go12
2 files changed, 9 insertions, 5 deletions
diff --git a/contrib/cirrus/rootless_test.sh b/contrib/cirrus/rootless_test.sh
index 88b38f45b..932af6d92 100755
--- a/contrib/cirrus/rootless_test.sh
+++ b/contrib/cirrus/rootless_test.sh
@@ -18,6 +18,8 @@ then
exit 1
fi
+export PODMAN_VARLINK_ADDRESS=unix:/tmp/podman-$(id -u)
+
echo "."
echo "Hello, my name is $USER and I live in $PWD can I be your friend?"
diff --git a/test/e2e/libpod_suite_remoteclient_test.go b/test/e2e/libpod_suite_remoteclient_test.go
index 44c5edf07..a85d21a48 100644
--- a/test/e2e/libpod_suite_remoteclient_test.go
+++ b/test/e2e/libpod_suite_remoteclient_test.go
@@ -139,19 +139,21 @@ func (p *PodmanTestIntegration) CleanupVolume() {
}
func PodmanTestCreate(tempDir string) *PodmanTestIntegration {
- if os.Geteuid() != 0 {
- ginkgo.Skip("This function is not enabled for rootless podman")
- }
pti := PodmanTestCreateUtil(tempDir, true)
pti.StartVarlink()
return pti
}
func (p *PodmanTestIntegration) StartVarlink() {
- if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
+ if os.Geteuid() == 0 {
os.MkdirAll("/run/podman", 0755)
}
- args := []string{"varlink", "--timeout", "0", "unix:/run/podman/io.podman"}
+ varlinkEndpoint := "unix:/run/podman/io.podman"
+ if addr := os.Getenv("PODMAN_VARLINK_ADDRESS"); addr != "" {
+ varlinkEndpoint = addr
+ }
+
+ args := []string{"varlink", "--timeout", "0", varlinkEndpoint}
podmanOptions := getVarlinkOptions(p, args)
command := exec.Command(p.PodmanBinary, podmanOptions...)
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))