summaryrefslogtreecommitdiff
path: root/test/varlink/run_varlink_tests.sh
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-03-26 09:39:14 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-23 14:29:45 +0000
commit8493dba23c73617d9529b7ca13b400d50ac6f455 (patch)
treec0de0c67334b9fa7166e01cae95dc560c1e2455a /test/varlink/run_varlink_tests.sh
parentcf1d884ffa45b342f38a78189bbd86186ce6cbfe (diff)
downloadpodman-8493dba23c73617d9529b7ca13b400d50ac6f455.tar.gz
podman-8493dba23c73617d9529b7ca13b400d50ac6f455.tar.bz2
podman-8493dba23c73617d9529b7ca13b400d50ac6f455.zip
Initial varlink implementation
Signed-off-by: baude <bbaude@redhat.com> Closes: #627 Approved by: mheon
Diffstat (limited to 'test/varlink/run_varlink_tests.sh')
-rw-r--r--test/varlink/run_varlink_tests.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/varlink/run_varlink_tests.sh b/test/varlink/run_varlink_tests.sh
new file mode 100644
index 000000000..9c247fec2
--- /dev/null
+++ b/test/varlink/run_varlink_tests.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -x
+if [ ! -n "${PYTHON+ }" ]; then
+ if hash python3 > /dev/null 2>&1 /dev/null; then
+ PYTHON=$(hash -t python3)
+ elif type python3 > /dev/null 2>&1; then
+ PYTHON=$(type python3 | awk '{print $3}')
+ elif hash python2 > /dev/null 2>&1; then
+ PYTHON=$(hash -t python2)
+ elif type python2 > /dev/null 2>&1; then
+ PYTHON=$(type python2 | awk '{print $3}')
+ else
+ PYTHON='/usr/bin/python'
+ fi
+fi
+
+# Create temporary directory for storage
+TMPSTORAGE=`mktemp -d`
+
+# Need a location to store the podman socket
+mkdir /run/podman
+
+# Run podman in background without systemd for test purposes
+bin/podman --storage-driver=vfs --root=${TMPSTORAGE}/crio --runroot=${TMPSTORAGE}/crio-run varlink unix:/run/podman/io.projectatomic.podman&
+
+# Record podman's pid to be killed later
+PODMAN_PID=`echo $!`
+
+# Run tests
+${PYTHON} -m unittest discover -s test/varlink/
+
+# Kill podman
+kill -9 ${PODMAN_PID}
+
+# Clean up
+rm -fr ${TMPSTORAGE}