Advertisement
ffilz

pynfs running script

Jul 29th, 2016 (edited)
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.32 KB | None | 0 0
  1. TAG=""
  2. SERVER=127.0.0.1
  3. DIR=/export/test1/pynfs
  4. DRYRUN=0
  5. PYUSER=""
  6. PYGROUP=""
  7. UTAG=""
  8. USESPECIAL=""
  9. SECUIRITY=""
  10. OUTPATH="/home/ffilz/ganesha/pynfs-results"
  11. EXEC="./testserver.py"
  12.  
  13. VERSION=`pwd | sed -e 's@.*/\(nfs4\.[0-9]\)$@\1@'`
  14.  
  15. if [ $VERSION = "nfs4.0" ] ; then
  16.     SECURE="--secure"
  17. else
  18.     SECURE=""
  19. fi
  20.  
  21. run_tests()
  22. {
  23.     FLAGS=`echo $* | sed -e 's@ @-@g'`
  24.     BASE=$OUTPATH/TESTOUT.$VERSION.$FLAGS
  25.     FILE=$BASE.$DATE$TAG$UTAG
  26.     if [ $DRYRUN -eq 0 ]
  27.     then
  28.         $EXEC -v --outfile $FILE.log --maketree $SERVER:$DIR  --showomit $SECURE $SECURITY $USESPECIAL $PYUSER $PYGROUP --rundeps $@
  29.         rc=$?
  30.         echo RC = $rc
  31.         if [ -e $FILE.log ] ; then
  32.             ../showresults.py  --showomit "$FILE.log" > "$FILE.out"
  33.             ../showresults.py  --showomit "$FILE.log" | grep -v PASS > "$FILE.fail"
  34.             echo "ls -ltr $BASE*"
  35.         fi
  36.     else
  37.         echo FLAGS=$FLAGS
  38.         echo $EXEC -v --outfile $FILE.log --maketree $SERVER:$DIR  --showomit $SECURE $SECURITY $USESPECIAL $PYUSER $PYGROUP --rundeps $@
  39.     fi
  40.     if [ -e $FILE.log ] || [ $DRYRUN -eq 1 ] ; then
  41.         echo ../showresults.py  --showomit $FILE.log
  42.         echo "results    saved to $FILE.log"
  43.         echo "output     saved to $FILE.out"
  44.         echo "failures   saved to $FILE.fail"
  45.         echo "ls -ltr $BASE*"
  46.     else
  47.         echo "----- FAILURE -----"
  48.     fi
  49. }
  50.  
  51. while getopts ":t:s:yud:xp:ck:3C" OPT; do
  52.     case $OPT in
  53.         t)  TAG=.$OPTARG
  54.             ;;
  55.         s)  SERVER=$OPTARG
  56.             ;;
  57.         d)  DIR=$OPTARG
  58.             ;;
  59.         y)  DRYRUN=1
  60.             ;;
  61.         x)      SECURE=""
  62.             ;;
  63.         u)  PYUSER="--uid=500"
  64.             PYGROUP="--gid=501"
  65.             UTAG=".user=ffilz"
  66.             DIR=$DIR/ffilz
  67.             ;;
  68.         \?) echo usage
  69.             echo "pynfs [-t tag] [-s server] [-d dir] [-x] [-u] [-p] [-k sec] [-y] test cases"
  70.             echo "        -t tag to add to file name to distinguish runs"
  71.             echo "        -s server to run against"
  72.             echo "        -d directory to run against"
  73.             echo "        -x don't use secure option for 4.0"
  74.             echo "        -u run as ffilz (500:501)"
  75.             echo "        -p run with --usespecial option"
  76.             echo "        -k specify security flavor to use"
  77.             echo "        -y dry run, just display the command that will be run and the files produced"
  78.             echo "        -3 run NFS3 tests"
  79.             echo
  80.             echo "pynfs [-c]"
  81.             echo "        show codes and flags for test cases"
  82.             echo
  83.             echo "pynfs [-?]"
  84.             echo "        show this help"
  85.             exit 1
  86.             ;;
  87.         p)  USESPECIAL="--usespecial=$OPTARG"
  88.             ;;
  89.         c)  $EXEC --showcodesflags
  90.             exit 0
  91.             ;;
  92.         k)  SECURITY="--security=$OPTARG"
  93.             ;;
  94.         3)  EXEC="./testserver3.py"
  95.             VERSION="nfs3.0"
  96.             ;;
  97.         C)  rm -Rf /export/test1/pynfs/
  98.             ;;
  99.     esac
  100. done
  101. shift $(($OPTIND - 1))
  102. DATE=`date +%Y-%m-%d`
  103.  
  104. # SATT1a runs only on FSAL_GPFS
  105. # RD12 assumes AUTH_SYS - OK to run though
  106. if [ -n "$1" ] ; then
  107.     if [ "$1" = bfskip ] ; then
  108.         run_tests CID1 CID6 SATT1a CIDCF2 COMP6 CR13 CR14 LINK4a LINK9 LOOKP2a OPCF3a OPEN4 RDDR12 RNM11 SATT12a WRT5 RD4 RM7 RNM10 LOCK19 LOCK22 DELEG11 DELEG12 DELEG13a DELEG13b DELEG13c DELEG13d DELEG13e GSS8 RD9g WRT10g
  109.     elif [ "$1" = gan ] ; then
  110.         if [ $VERSION = "nfs4.0" ] ; then
  111.             run_tests ganesha RD12 LOCK8c
  112.         elif [ $VERSION = "nfs4.1" ] ; then
  113.             run_tests ganesha
  114.         else
  115.             run_tests ganesha
  116.         fi
  117.     else
  118.         run_tests $@
  119.     fi
  120. else
  121.     if [ $VERSION = "nfs4.0" ] ; then
  122.         run_tests all ganesha RD12 LOCK8c
  123.     elif [ $VERSION = "nfs4.1" ] ; then
  124.         run_tests all ganesha
  125.     else
  126.         run_tests all
  127.     fi
  128. fi
  129.  
  130. exit $rc
  131.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement