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
|
#!/bin/sh
# PCP QA Test No. 1007
# Check handling of "tab" keyword in configuration language.
#
seq=`basename $0`
echo "QA output created by $seq"
status=0 # success is the default!
. ./common.qt
trap "_cleanup_qt; exit \$status" 0 1 2 3 15
which pmchart >/dev/null 2>&1 || _notrun "pmchart not installed"
# looks like a Qt race, but onl seen on FreeBSD 14.3 (vm06)
#
_filter()
{
_filter_views \
| sed -e '/QThreadStorage: entry [0-9] destroyed before end of thread /d'
}
# real QA test starts here
echo "=== Valid, no error ==="
cat <<End-of-File | pmchart -c - -C 2>&1 | _filter
#kmchart
version 1
tab "1" points 300 samples 300
chart title "Tab Test" style stacking
plot legend "User" color #2d2de2 metric kernel.all.cpu.user
tab "2" points 0 samples 20
tab "3" points 20 samples 200
End-of-File
echo "=== Bad syntax, no tab specification ==="
cat <<End-of-File | pmchart -c - -C 2>&1 | _filter
#kmchart
version 1
tab
End-of-File
echo "=== Bad syntax, no point keyword ==="
cat <<End-of-File | pmchart -c - -C 2>&1 | _filter
#kmchart
version 1
tab "Indexing Host" 300
End-of-File
echo "=== Bad syntax, no point value ==="
cat <<End-of-File | pmchart -c - -C 2>&1 | _filter
#kmchart
version 1
tab "DB" points
End-of-File
echo "=== Bad syntax, no sample value ==="
cat <<End-of-File | pmchart -c - -C 2>&1 | _filter
#kmchart
version 1
tab "App" points 34 samples
End-of-File
exit
|