summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-08-07 14:24:23 -0600
committerEd Santiago <santiago@redhat.com>2019-08-08 11:44:55 -0600
commit5c108cdab4888c53fbe7d4cb546544cc5a4929aa (patch)
tree8959a746011ee94b552379da04f7749db096d160 /Makefile
parent3959a357f7cefc9e3494042781fe0978e621cccc (diff)
downloadpodman-5c108cdab4888c53fbe7d4cb546544cc5a4929aa.tar.gz
podman-5c108cdab4888c53fbe7d4cb546544cc5a4929aa.tar.bz2
podman-5c108cdab4888c53fbe7d4cb546544cc5a4929aa.zip
implement 'make remotesystem'
podman-remote rm now works; that's the only thing we were waiting for to enable podman-remote (varlink) system tests. Add a (too-complicated, sorry) Makefile target that will define a random socket path, start the podman varlink server, and run the test suite using podman-remote. Also: add two convenience functions, is_rootless and is_remote, and use those in skip_if_rootless/if_remote and elsewhere Also: workarounds for broken tests: - basic version test: podman-remote emits an empty 'Client' line. Just ignore it. - looks like 'podman-remote pod' doesn't work; skip test. Also: minor documentation update Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 26 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dbc10aa8c..c9d515b65 100644
--- a/Makefile
+++ b/Makefile
@@ -253,10 +253,34 @@ remoteintegration: varlink_generate test-binaries ginkgo-remote
localsystem:
# Wipe existing config, database, and cache: start with clean slate.
$(RM) -rf ${HOME}/.local/share/containers ${HOME}/.config/containers
- if timeout -v 1 true; then PODMAN=./bin/podman bats test/system/; else echo "Skipping localsystem: 'timeout -v' unavailable'"; fi
+ if timeout -v 1 true; then PODMAN=./bin/podman bats test/system/; else echo "Skipping $@: 'timeout -v' unavailable'"; fi
remotesystem:
- @echo "remotesystem - unimplemented"
+ # Wipe existing config, database, and cache: start with clean slate.
+ $(RM) -rf ${HOME}/.local/share/containers ${HOME}/.config/containers
+ # Start varlink server using tmp socket; loop-wait for it;
+ # test podman-remote; kill server, clean up tmp socket file.
+ # varlink server spews copious unhelpful output; ignore it.
+ rc=0;\
+ if timeout -v 1 true; then \
+ SOCK_FILE=$(shell mktemp --dry-run --tmpdir io.podman.XXXXXX);\
+ export PODMAN_VARLINK_ADDRESS=unix:$$SOCK_FILE; \
+ ./bin/podman varlink --timeout=0 $$PODMAN_VARLINK_ADDRESS &>/dev/null & \
+ retry=5;\
+ while [[ $$retry -ge 0 ]]; do\
+ echo Waiting for varlink server...;\
+ sleep 1;\
+ ./bin/podman-remote info &>/dev/null && break;\
+ retry=$$(expr $$retry - 1);\
+ done;\
+ env PODMAN=./bin/podman-remote bats test/system/ ;\
+ rc=$$?;\
+ kill %1;\
+ rm -f $$SOCK_FILE;\
+ else \
+ echo "Skipping $@: 'timeout -v' unavailable'";\
+ fi;\
+ exit $$rc
system.test-binary: .install.ginkgo
$(GO) test -c ./test/system