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