Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / qa / 379
blob226961fc34691640cefc69900f2edc7921576221
1 #!/bin/sh
2 # PCP QA Test No. 379
3 # Exercise Cisco PMDA parser
5 # Copyright (c) 2015 Red Hat.
6 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 [ -f $PCP_PMDAS_DIR/cisco/pmdacisco ] || _notrun "cisco pmda not installed"
19 status=0 # success is the default!
20 $sudo rm -rf $tmp.* $seq.full
21 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
23 _check()
25 echo
26 file=$1
27 shift
28 args=""
29 for x
31 args="$args $x"
32 done
33 intf=`$PCP_PMDAS_DIR/cisco/probe -N $args $file 2>/dev/null`
34 if [ -z "$intf" ]
35 then
36 echo "$file: Argh ... cannot extract list of interfaces!"
37 return
39 for x in $intf
41 args="$args $file:$x"
42 done
43 echo "=== $args ==="
44 $PCP_PMDAS_DIR/cisco/parse -N $args 2>&1 \
45 | sed \
46 -e 's/fd=4/fd=3/' \
47 -e '/Sleeping while sproc does the work/d'
50 # real QA test starts here
51 cd cisco
52 cat <<'End-of-File' | while read file args
53 Serial-0 -Dappl2
54 Serial-0
55 Ethernet-0 -Ulogin
56 Fddi-2-0 -Ulogin -Psecret
57 Serial-1
58 Ethernet-3-5
59 ATM-12-0
60 Hssi-3-0
61 FastEthernet-1-0 -s cmd#
62 Serial-1-0-min
63 Serial-1-0-sec
64 Ethernet-1-0
65 Vlan-256
66 Vlan-1 -Ulogin -Psecret -s bgo-sw20#
67 Vlan-160 -Ulogin -Psecret -s bgo-sw20#
68 FastEthernet-0-5 -Ulogin -Psecret -s bgo-sw20#
69 FastEthernet-0-6 -Ulogin -Psecret -s bgo-sw20#
70 GigabitEthernet-0-1 -Ulogin -Psecret -s bgo-sw20#
71 End-of-File
73 _check $file $args
74 done
76 # success, all done
77 exit