Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | # |
| 3 | #This script is used to run acl test suites |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 5 | #umask 077 |
| 6 | |
| 7 | EXT3_IMAGE=ext3.img |
| 8 | EXT3_MOUNT_POINT=/mnt/ext3 |
| 9 | |
| 10 | trap 'rm -f ${EXT3_IMAGE}' EXIT |
| 11 | |
| 12 | dd if=/dev/zero of=${EXT3_IMAGE} bs=1M count=1 |
| 13 | if [ "$?" -eq 0 ]; then |
| 14 | echo "PASS: dump ext3.img" |
| 15 | else |
| 16 | echo "FAIL: dump ext3.img" |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | mkfs.ext3 -F ${EXT3_IMAGE} |
| 21 | if [ "$?" -eq 0 ]; then |
| 22 | echo "PASS: mkfs.ext3 -F ext3.img" |
| 23 | else |
| 24 | echo "FAIL: mkfs.ext3 -F ext3.img" |
| 25 | exit 1 |
| 26 | fi |
| 27 | |
| 28 | if [ -d $EXT3_MOUNT_POINT ]; then |
| 29 | echo "mount point exist" |
| 30 | else |
| 31 | mkdir -p $EXT3_MOUNT_POINT |
| 32 | fi |
| 33 | |
| 34 | |
| 35 | mount -o loop,rw,acl ${EXT3_IMAGE} $EXT3_MOUNT_POINT |
| 36 | if [ "$?" -eq 0 ]; then |
| 37 | echo "PASS: mount ext3.img" |
| 38 | else |
| 39 | echo "FAIL: mount ext3.img" |
| 40 | exit 1 |
| 41 | fi |
| 42 | |
| 43 | cp -rf ./test/ $EXT3_MOUNT_POINT |
| 44 | |
| 45 | cd $EXT3_MOUNT_POINT/test/ |
| 46 | |
| 47 | if sed -e 's!^bin:x:2:$!bin:x:2:daemon!' < /etc/group > gtmp |
| 48 | then if cp /etc/group group.orig; |
| 49 | then cp gtmp /etc/group |
| 50 | make -k tests root-tests | sed \ |
| 51 | -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \ |
| 52 | -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|' |
| 53 | cp group.orig /etc/group |
| 54 | else echo "FAIL: couldn't save original group file." |
| 55 | exit 1 |
| 56 | fi |
| 57 | else echo "FAIL: couldn't create modified group file." |
| 58 | exit 1 |
| 59 | fi |
| 60 | |
| 61 | cd - |
| 62 | umount $EXT3_MOUNT_POINT |
| 63 | rm -rf $EXT3_MOUNT_POINT |
| 64 | rm $EXT3_IMAGE |