zsh completions: minor tweaks
[pcp.git] / qa / 546
blobd115e786a4ff3bbff0f7ab6a6f3ee41f7db2699b
1 #!/bin/sh
2 # PCP QA Test No. 546
3 # Check parsing of PMCD access section user/group extensions with errors
5 # Copyright (c) 2013 Red Hat.
6 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 . ./common.secure
14 _get_libpcp_config
15 $unix_domain_sockets || _notrun "No unix domain socket support available"
17 status=1 # failure is the default!
18 $sudo rm -rf $tmp.* $seq.full
19 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
21 _filter()
23 sed \
24 -e "s:$tmp:TMP:g" \
25 -e "s:$userid $username:USERID USERNAME:g" \
26 -e "s:$groupid $groupname:GROUPID GROUPNAME:g" \
27 -e "s:$userid\($username\):USERID(USERNAME):g" \
28 -e "s:$groupid\($groupname\):GROUPID(GROUPNAME):g" \
32 # new access control cases, not checked in QA 051 or 454
33 # real QA test starts here
34 export PCP_PMCDCONF_PATH=$tmp.conf
35 export PMCD_PORT=9876
36 export PMCD_SOCKET=$tmp.pmcd.socket
38 # user test cases
40 cat <<End-of-File >$tmp.conf
41 sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29
42 [access]
43 allow user nosuchuser ;
44 allow user $username : ;
45 allow user $username : fetch, ;
46 allow user $username : fetch, maximum 7 connections, store, maximum 3 connections;
47 allow user $username : fetch, maximum foo connections;
48 End-of-File
49 pmcd -v | _filter
51 cat <<End-of-File >$tmp.conf
52 sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29
53 [access]
54 allow user $username : store
55 End-of-File
56 pmcd -v | _filter
58 cat <<End-of-File >$tmp.conf
59 sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29
60 [access]
61 allow user $username, nosuchuser
62 End-of-File
63 pmcd -v | _filter
65 # group test cases
67 cat <<End-of-File >$tmp.conf
68 sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29
69 [access]
70 allow group nosuchgroup ;
71 allow group $groupname : ;
72 allow group $groupname : fetch, ;
73 allow group $groupname : fetch, maximum 7 connections, store, maximum 3 connections;
74 allow group $groupname : fetch, maximum foo connections;
75 End-of-File
76 pmcd -v | _filter
78 cat <<End-of-File >$tmp.conf
79 sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29
80 [access]
81 allow group $groupname : store
82 End-of-File
83 pmcd -v | _filter
85 cat <<End-of-File >$tmp.conf
86 sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29
87 [access]
88 allow group $groupname, nosuchgroup
89 End-of-File
90 pmcd -v | _filter
92 # success, all done
93 status=0
95 exit