ceph-csi/vendor/github.com/kubernetes-csi/drivers/hack/e2e-hostpath.sh

46 lines
887 B
Bash
Raw Normal View History

2018-02-15 13:50:31 +00:00
#!/bin/bash
## This file is for app/hostpathplugin
## It could be used for other apps in this repo, but
## those applications may or may not take the same
## arguments
## Must be run from the root of the repo
UDS="/tmp/e2e-csi-sanity.sock"
CSI_ENDPOINT="unix://${UDS}"
CSI_MOUNTPOINT="/mnt"
APP=hostpathplugin
SKIP="WithCapacity"
if [ x${TRAVIS} = x"true" ] ; then
2018-11-26 18:23:56 +00:00
SKIP="ValidateVolumeCapabilities"
2018-02-15 13:50:31 +00:00
fi
# Get csi-sanity
2018-11-26 18:23:56 +00:00
./hack/get-sanity.sh
2018-02-15 13:50:31 +00:00
# Build
2018-07-18 14:47:22 +00:00
make hostpath
2018-02-15 13:50:31 +00:00
# Cleanup
rm -f $UDS
# Start the application in the background
2018-07-18 14:47:22 +00:00
sudo _output/$APP --endpoint=$CSI_ENDPOINT --nodeid=1 &
2018-02-15 13:50:31 +00:00
pid=$!
# Need to skip Capacity testing since hostpath does not support it
sudo $GOPATH/bin/csi-sanity $@ \
--ginkgo.skip=${SKIP} \
2018-07-18 14:47:22 +00:00
--csi.mountdir=$CSI_MOUNTPOINT \
2018-02-15 13:50:31 +00:00
--csi.endpoint=$CSI_ENDPOINT ; ret=$?
sudo kill -9 $pid
sudo rm -f $UDS
if [ $ret -ne 0 ] ; then
exit $ret
fi
exit 0