summaryrefslogtreecommitdiff
path: root/test/varlink/run_varlink_tests.sh
blob: 8372de10bfae51b1c5a0cf0fd46696a459ce4b5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

if [ ! -n "${PYTHON+ }" ]; then
  if hash python3 > /dev/null 2>&1; 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 /tmp/podman.XXXXXXXXXX`
trap 'rm -fr ${TMPSTORAGE}' EXIT

export PODMAN_HOST="unix:${TMPSTORAGE}/podman/io.projectatomic.podman"

# Need a location to store the podman socket
mkdir -p ${TMPSTORAGE}/podman

systemd-cat -t podman -p notice bin/podman --version

set -x
# Run podman in background without systemd for test purposes
systemd-cat -t podman -p notice \
  bin/podman --storage-driver=vfs --root=${TMPSTORAGE}/crio \
  --runroot=${TMPSTORAGE}/crio-run varlink ${PODMAN_HOST} &

${PYTHON} -m unittest discover -s test/varlink/ $@
pkill podman