test: Skip networking tests if CNI plugins are missing

If the CNI binaries (bridge and host-local) are not installed,
we skip the tests.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2016-12-17 15:21:11 +01:00
parent 4c702fb60c
commit b97a57c006
No known key found for this signature in database
GPG key ID: 8A803CDD4F566C4A
2 changed files with 17 additions and 0 deletions

View file

@ -46,6 +46,7 @@ fi
OCID_SOCKET="$TESTDIR/ocid.sock"
OCID_CONFIG="$TESTDIR/ocid.conf"
OCID_CNI_CONFIG="$TESTDIR/cni/net.d/"
OCID_CNI_PLUGIN="/opt/cni/bin/"
POD_CIDR="10.88.0.0/16"
POD_CIDR_MASK="10.88.*.*"

View file

@ -8,6 +8,14 @@ load helpers
skip "cannot yet run this test in a container, use sudo make localintegration"
fi
if [ ! -f "$OCID_CNI_PLUGIN/bridge" ]; then
skip "missing CNI bridge plugin, please install it"
fi
if [ ! -f "$OCID_CNI_PLUGIN/host-local" ]; then
skip "missing CNI host-local IPAM, please install it"
fi
prepare_network_conf $POD_CIDR
start_ocid
@ -29,6 +37,14 @@ load helpers
skip "cannot yet run this test in a container, use sudo make localintegration"
fi
if [ ! -f "$OCID_CNI_PLUGIN/bridge" ]; then
skip "missing CNI bridge plugin, please install it"
fi
if [ ! -f "$OCID_CNI_PLUGIN/host-local" ]; then
skip "missing CNI host-local IPAM, please install it"
fi
prepare_network_conf $POD_CIDR
start_ocid