blob: a56946d8e6f3443a90e021e6f2b3c936dc33bfd5 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002#
3#This script is used to run acl test suites
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
Patrick Williamsc0f7c042017-02-23 20:41:17 -06005#umask 077
6
7EXT3_IMAGE=ext3.img
8EXT3_MOUNT_POINT=/mnt/ext3
9
10trap 'rm -f ${EXT3_IMAGE}' EXIT
11
12dd if=/dev/zero of=${EXT3_IMAGE} bs=1M count=1
13if [ "$?" -eq 0 ]; then
14 echo "PASS: dump ext3.img"
15else
16 echo "FAIL: dump ext3.img"
17 exit 1
18fi
19
20mkfs.ext3 -F ${EXT3_IMAGE}
21if [ "$?" -eq 0 ]; then
22 echo "PASS: mkfs.ext3 -F ext3.img"
23else
24 echo "FAIL: mkfs.ext3 -F ext3.img"
25 exit 1
26fi
27
28if [ -d $EXT3_MOUNT_POINT ]; then
29 echo "mount point exist"
30else
31 mkdir -p $EXT3_MOUNT_POINT
32fi
33
34
35mount -o loop,rw,acl ${EXT3_IMAGE} $EXT3_MOUNT_POINT
36if [ "$?" -eq 0 ]; then
37 echo "PASS: mount ext3.img"
38else
39 echo "FAIL: mount ext3.img"
40 exit 1
41fi
42
43cp -rf ./test/ $EXT3_MOUNT_POINT
44
45cd $EXT3_MOUNT_POINT/test/
46
47if sed -e 's!^bin:x:2:$!bin:x:2:daemon!' < /etc/group > gtmp
48then 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
57else echo "FAIL: couldn't create modified group file."
58 exit 1
59fi
60
61cd -
62umount $EXT3_MOUNT_POINT
63rm -rf $EXT3_MOUNT_POINT
64rm $EXT3_IMAGE