2006-11-06 17:05:00 +01:00
|
|
|
#!/bin/sh
|
2009-05-11 12:02:49 +02:00
|
|
|
|
2006-11-06 17:05:00 +01:00
|
|
|
#
|
|
|
|
# run this script _before_ you do a commit and fix errors before uploading
|
|
|
|
#
|
2006-12-18 14:37:08 +01:00
|
|
|
# preparations:
|
|
|
|
# - add the following lines to /etc/super.tab:
|
|
|
|
# :global_options relative_path=y
|
|
|
|
# CryptoBoxRootActionsLocal ./CryptoBoxRootActions cryptobox
|
|
|
|
#
|
2006-11-06 17:05:00 +01:00
|
|
|
|
2009-05-11 12:02:49 +02:00
|
|
|
GETOPT="getopt"
|
2006-11-27 20:25:26 +01:00
|
|
|
BASE_DIR=$(cd "$(dirname $0)/.."; pwd)
|
|
|
|
|
|
|
|
export PYTHONPATH=$BASE_DIR/src
|
|
|
|
|
2008-04-06 18:08:34 +02:00
|
|
|
disable_filecheck()
|
2006-12-18 14:37:08 +01:00
|
|
|
{
|
|
|
|
sed -i "s/^OVERRIDE_FILECHECK = .*$/OVERRIDE_FILECHECK = True/" "$BASE_DIR/bin/CryptoBoxRootActions"
|
|
|
|
}
|
|
|
|
|
2008-04-06 18:08:34 +02:00
|
|
|
enable_filecheck()
|
2006-12-18 14:37:08 +01:00
|
|
|
{
|
|
|
|
sed -i "s/^OVERRIDE_FILECHECK = .*$/OVERRIDE_FILECHECK = False/" "$BASE_DIR/bin/CryptoBoxRootActions"
|
|
|
|
}
|
|
|
|
|
2009-05-11 12:02:49 +02:00
|
|
|
#Using getopt(1) would be the super-thorough way to do this; use the
|
|
|
|
#quick-and-dirty method instead
|
|
|
|
# case $1 in
|
|
|
|
# --clobber=*)
|
|
|
|
# TEST_DISK=`echo $1 | sed 's/[-a-zA-Z0-9]*=//'`
|
|
|
|
# ;;
|
|
|
|
# *)
|
|
|
|
# ;;
|
|
|
|
#
|
|
|
|
#esac
|
|
|
|
#parse out the remaining command line arguments
|
|
|
|
|
|
|
|
## now check that TEST_DISK is not empty and is a block device (more flexibility could possibly be added)
|
|
|
|
|
|
|
|
####################################################################3
|
|
|
|
##Attention!!! Don't check this in with the following variable set!
|
|
|
|
##
|
|
|
|
## the "/dev/" prefix is already assumed by the test classes
|
|
|
|
#CNAS_UTEST_CLOBBER="sdb"
|
|
|
|
CNAS_UTEST_CLOBBER=""
|
|
|
|
|
|
|
|
export CNAS_UTEST_CLOBBER
|
|
|
|
|
2006-11-06 17:05:00 +01:00
|
|
|
|
2006-12-12 14:34:05 +01:00
|
|
|
dest_files=""
|
|
|
|
while test $# -gt 0
|
|
|
|
do files="${files} $(cd $(dirname $1); pwd)/$(basename $1)"
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2006-11-27 20:25:26 +01:00
|
|
|
# chdir to 'bin' - all config settings depend on this
|
|
|
|
cd "${BASE_DIR}/bin"
|
|
|
|
|
2006-12-18 14:37:08 +01:00
|
|
|
disable_filecheck
|
|
|
|
|
2006-12-12 14:34:05 +01:00
|
|
|
if test -n "$files"
|
|
|
|
then # do the specified tests
|
|
|
|
for a in $files
|
|
|
|
do testoob -v "$a"
|
|
|
|
done
|
|
|
|
else # do all tests
|
|
|
|
for a in ${BASE_DIR}/src/cryptobox/tests/test.*.py
|
|
|
|
do testoob -v "$a"
|
|
|
|
done
|
|
|
|
fi
|
2006-11-06 17:05:00 +01:00
|
|
|
|
2006-12-18 14:37:08 +01:00
|
|
|
enable_filecheck
|
2007-01-06 12:40:38 +01:00
|
|
|
|