3 # what the hell is chkhelp supposed to do?
5 # Copyright (c) 2015 Red Hat.
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 [ -f $PCP_PMDAS_DIR/cisco
/pmdacisco
] || _notrun
"cisco pmda not installed"
22 -e '/illegal key/s/(-*[0-9][0-9]*)/(SIZE)/' \
30 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;"
33 trap "rm -f $tmp.*; exit" 0 1 2 3 15
35 # real QA test starts here
38 if [ ! -f $PCP_PMDAS_DIR/cisco
/help.pag
]
40 # no compiled help text, so the cisco PMDA has never been installed
41 # here ... the only way to make this file appear is Install and Remove
42 # the PMDA ... this should be a no-op, but may take a while
44 cd $PCP_PMDAS_DIR/cisco
46 $sudo .
/Install
</dev
/null
>/dev
/null
2>&1
48 if [ ! -f $PCP_PMDAS_DIR/cisco
/help.pag
]
50 echo "Arrggh, need $PCP_PMDAS_DIR/cisco/help.pag and cannot remake it!"
55 $sudo chmod 644 $PCP_PMDAS_DIR/cisco
/help.
*
59 dd if=/dev
/zero ibs
=1024 count
=4 of
=$tmp.pag
>/dev
/null
2>&1
61 echo "chkhelp bad-helpfile"
62 chkhelp
$tmp >$tmp.out
2>&1
64 _filter_illegal
<$tmp.out
66 echo "chkhelp -p bad-helpfile"
67 chkhelp
-p $tmp >$tmp.out
2>&1
69 _filter_illegal
<$tmp.out
71 echo "chkhelp bad-helpfile cisco.rate_in"
72 chkhelp
$tmp cisco.rate_in
2>&1 | _filter_illegal
76 echo "some usage failures ..."
77 echo 'chkhelp -i $PCP_PMDAS_DIR/cisco/help cisco.rate_in'
78 chkhelp
-i $PCP_PMDAS_DIR/cisco
/help cisco.rate_in
2>&1 \
80 echo 'chkhelp -p $PCP_PMDAS_DIR/cisco/help cisco.rate_in'
81 chkhelp
-p $PCP_PMDAS_DIR/cisco
/help cisco.rate_in
2>&1 \
83 echo 'chkhelp -ip $PCP_PMDAS_DIR/cisco/help cisco.rate_in'
84 chkhelp
-ip $PCP_PMDAS_DIR/cisco
/help cisco.rate_in
2>&1 \
88 echo "debug trace ..."
89 echo 'chkhelp -D 2048 $PCP_PMDAS_DIR/cisco/help'
90 chkhelp
-D 2048 $PCP_PMDAS_DIR/cisco
/help 2>&1 \
94 echo "exercise options ..."
104 for metric
in "" cisco.rate_in
"cisco.rate_in cisco.rate_out"
106 if [ "X$p" = "X-p" -o "X$i" = "X-i" ]
108 [ "X$metric" != X
] && continue
111 echo "args: $h $o $i $p $metric"
112 chkhelp
$h $o $i $p \
113 -n $PCP_PMDAS_DIR/cisco
/root \
114 $PCP_PMDAS_DIR/cisco
/help $metric >$tmp.out
2>&1
116 _filter_chk
<$tmp.out
126 # see comments above when help.pag created for cisco PMDA
128 cd $PCP_PMDAS_DIR/cisco
130 $sudo .
/Remove
</dev
/null
>/dev
/null
2>&1