#!/bin/sh # # run this script _before_ you do a commit and fix errors before uploading # # preparations: # - add the following lines to /etc/super.tab: # :global_options relative_path=y # CryptoBoxRootActionsLocal ./CryptoBoxRootActions cryptobox # GETOPT="getopt" BASE_DIR=$(cd "$(dirname $0)/.."; pwd) export PYTHONPATH=$BASE_DIR/src disable_filecheck() { sed -i "s/^OVERRIDE_FILECHECK = .*$/OVERRIDE_FILECHECK = True/" "$BASE_DIR/bin/CryptoBoxRootActions" } enable_filecheck() { sed -i "s/^OVERRIDE_FILECHECK = .*$/OVERRIDE_FILECHECK = False/" "$BASE_DIR/bin/CryptoBoxRootActions" } #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 dest_files="" while test $# -gt 0 do files="${files} $(cd $(dirname $1); pwd)/$(basename $1)" shift done # chdir to 'bin' - all config settings depend on this cd "${BASE_DIR}/bin" disable_filecheck 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 enable_filecheck