zfs_autobackup/run_tests
Edwin Eefting e54c275685 fix
2020-05-18 17:01:46 +02:00

40 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
if [ "$USER" != "root" ]; then
echo "Need root to do proper zfs testing"
exit 1
fi
#reactivate python environment, if any (usefull in Travis)
[ "$VIRTUAL_ENV" ] && source $VIRTUAL_ENV/bin/activate
echo "####################################################"
echo "##### Unit testing against"
echo "##### Python : `python --version 2>&1 |sed 's/.* //'`"
echo "##### ZFS userspace : `dpkg-query -W zfsutils-linux |cut -f2`"
echo "##### ZFS kernel : `modinfo zfs|grep ^version |sed 's/.* //'` "
echo "####################################################"
# test needs ssh access to localhost for testing
if ! [ -e /root/.ssh/id_rsa ]; then
ssh-keygen -t rsa -f /root/.ssh/id_rsa -P '' || exit 1
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys || exit 1
ssh -oStrictHostKeyChecking=no localhost true || exit 1
fi
coverage run --source bin.zfs_autobackup -m unittest discover -v
EXIT=$?
echo
coverage report
#this does automatic travis CI/https://coveralls.io/ intergration:
if which coveralls > /dev/null; then
echo "Submitting to coveralls.io:"
coveralls
fi
exit $EXIT