pmrep: fix archive end time reporting
[pcp.git] / qa / 471
blob1866ea6ebdf3c79959a5dc0c3bbbb485c1823be7
1 #! /bin/sh
2 # PCP QA Test No. 471
3 # test fix for #621699 pcp scripts should check the user has root access
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 environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19 # real QA test starts here
21 cat << EOFEOF > $tmp.script
22 #! /bin/sh
23 . $PCP_SHARE_DIR/lib/pmdaproc.sh
24 _check_userroot
25 EOFEOF
27 chmod 755 $tmp.script
29 echo "1. testing _check_userroot as a normal user (error is expected)"
30 $tmp.script
32 echo
33 echo
35 echo "2. testing _check_userroot as the root user (no output expected)"
36 $sudo $tmp.script
38 # success, all done
39 status=0
40 exit