Home | History | Annotate | Download | only in acl
      1 #!/bin/sh
      2 #
      3 #       @(#)runtests
      4 #
      5 # runtests script for ACL testing
      6 REMOTEHOST=nfsserver
      7 MAXLENGTH=30 # maximum ACL length - NB: the current NFSv4 acl implementation does not allow ACL greater than one page (about 35 entries with 6 character user name length and 10 character domain name)
      8 NFSMNTDIR=/mnt/nfs-acl
      9 echo "Test on NFS server $REMOTEHOST"
     10 ACLTESTDIR=testdir
     11 ACLTESTFILE=testfile
     12 
     13 USER_NB=20 # total number of users to create
     14 GRP_NB=20 # total number of groups to create
     15 FILE_NB=10 # total number of files for the test
     16 
     17 # creation of users on the local machine
     18 for i in 1 2 3 4 5
     19 do
     20 	groupadd -g 60$i grp$i
     21 	useradd -u 60$i  user$i
     22 done
     23 
     24 #  creation of users on the remote machine (removed only at the end of the tests)
     25 rsh -n $REMOTEHOST python $PWD/create_users.py -u 50 -g 50
     26 
     27 echo "Starting ACL testing"
     28 
     29 echo "Starting BASIC tests"
     30 
     31 echo "Creating testing file and directory"
     32 touch $NFSMNTDIR/$ACLTESTFILE
     33 mkdir $NFSMNTDIR/$ACLTESTDIR
     34 if test ! -d $NFSMNTDIR/$ACLTESTDIR
     35 then
     36 	echo "Can't make directory $ACLTESTDIR"
     37 	exit 1
     38 fi
     39 
     40 # File and Directory tree creation test
     41 echo "Execute acl1 $NFSMNTDIR/$ACLTESTFILE $NFSMNTDIR/$ACLTESTDIR"
     42 ./acl1 $NFSMNTDIR/$ACLTESTFILE $NFSMNTDIR/$ACLTESTDIR
     43 #./stress $ACLTESTFILE
     44 for i in 1 2 3 4 5
     45     do
     46         userdel user$i
     47         groupdel grp$i
     48     done
     49 
     50 echo "Basic tests finished"
     51 
     52 echo "LONG ACL TEST"
     53 echo "creating necessary users and groups"
     54 python create_users.py -u 50 -g 50
     55 echo "creating necessary users and groups on the remote host"
     56 mkdir $NFSMNTDIR/lacl-testdir
     57 python test_long_acl.py -l $MAXLENGTH -p $NFSMNTDIR/lacl-testdir
     58 rm -rf $NFSMNTDIR/lacl-testdir
     59 echo "Long ACL test OK with $MAXLENGTH entries"
     60 echo "ACL STRESSING TEST"
     61 python setacl_stress.py -n 100 -u $USER_NB -g $GRP_NB -f $FILE_NB -p $NFSMNTDIR
     62 
     63 # remove local an remote users
     64 python cleanusers.py
     65 python cleangroups.py
     66 rsh -n $REMOTEHOST python $PWD/cleanusers.py
     67 
     68 echo "Test OK"
     69 
     70 exit 0
     71