Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 082
blob934c9aac5ddd97711e1273d459851e211944a5e6
1 #! /bin/sh
2 # PCP QA Test No. 082
3 # Test permissions left on namespace by pmnsadd, pmnsdel
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.filter
15 trap "cd $here; rm -rf $tmp; exit" 0 1 2 3 15
17 _ls()
19 ls -l \
20 | sed \
21 -e '/^total /d' \
22 -e 's/-rw-r--r--\./-rw-r--r--/' \
23 -e 's/----------\./----------/' \
24 | $PCP_AWK_PROG '
25 { print $1, $NF }'
26 echo
29 # real QA test starts here
31 umask 022
33 rm -rf $tmp
34 mkdir $tmp
35 cd $tmp
36 cat <<End-of-File >root
37 root {
38 fred 0:0:0
39 bear 0:0:1
41 End-of-File
43 cat <<End-of-File >foo
44 foo {
45 bar 1:0:0
47 End-of-File
49 umask 777
50 touch new-default-mode
51 echo "permissions before add:"
52 _ls
54 pmnsadd -n root foo
56 echo
57 echo "permissions after add:"
58 _ls
60 echo "Expect fred, bear and foo.bar ..."
61 pminfo -n root
63 pmnsdel -n root foo
65 echo
66 echo "permissions after delete:"
67 _ls
69 echo "Expect fred and bear ..."
70 pminfo -n root
72 exit 0