3 # Exercise pmdapipe config file parsing and error handling.
5 # Copyright (c) 2015 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ -f $PCP_PMDAS_DIR/pipe
/pmdapipe
] || _notrun
"pipe PMDA not installed"
18 status
=1 # failure is the default!
21 $sudo rm -f $tmp.
* $seq.full
22 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
26 echo $@ |
tee -a $seq.full
32 -e "s,$tmp.config,CONFIG,g" \
33 -e "s,$groupname,NAME,g" \
34 -e "s,$username,NAME,g" \
40 debug
="APPL0,APPL1,APPL2"
41 $PCP_PMDAS_DIR/pipe
/pmdapipe
-C -c $tmp.config
-D $debug >$tmp.log
2>&1
43 cat $tmp.log |
tee -a $seq.full | _filter
44 echo "sts=$sts" && echo
49 _log
"== checking instance name with special characters"
50 echo ';34@#bleurg root /bin/true' > $tmp.config
53 _log
"== checking missing user and command fields"
54 echo 'instance' > $tmp.config
57 _log
"== checking missing command field"
58 echo 'instance user ' > $tmp.config
61 _log
"== checking valid access control section"
62 echo 'instance user command and parameters' > $tmp.config
63 echo '[access]' >> $tmp.config
64 echo "allow user $username : instance" >> $tmp.config
65 echo "disallow user $username : instance" >> $tmp.config
66 echo "allow group $groupname : instance" >> $tmp.config
67 echo "disallow group $groupname : instance" >> $tmp.config
70 # save a copy of goodness to append badness to
71 cp $tmp.config
$tmp.valid
73 _log
"== checking invalid access control line (no username)"
74 cp $tmp.valid
$tmp.config
75 echo "allow user" >> $tmp.config
78 _log
"== checking invalid access control line (no separator)"
79 cp $tmp.valid
$tmp.config
80 echo "allow group $groupname " >> $tmp.config
83 _log
"== checking invalid access control line (no instance)"
84 cp $tmp.valid
$tmp.config
85 echo "allow group $groupname : " >> $tmp.config