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