diff options
Diffstat (limited to 'meta/recipes-support/attr/acl/run-ptest')
-rw-r--r-- | meta/recipes-support/attr/acl/run-ptest | 67 |
1 files changed, 62 insertions, 5 deletions
diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest index 3b31cc99af..a56946d8e6 100644 --- a/meta/recipes-support/attr/acl/run-ptest +++ b/meta/recipes-support/attr/acl/run-ptest | |||
@@ -1,7 +1,64 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | ||
3 | #This script is used to run acl test suites | ||
2 | 4 | ||
3 | gpasswd -a daemon bin | 5 | #umask 077 |
4 | make -C test -k tests root-tests |sed \ | 6 | |
5 | -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \ | 7 | EXT3_IMAGE=ext3.img |
6 | -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|' | 8 | EXT3_MOUNT_POINT=/mnt/ext3 |
7 | gpasswd -d daemon bin | 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 | ||