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
|
#!/bin/sh
# PCP QA Test No. 1633
# Exercise the pcp-ss(1) command using an archive
#
# Copyright (c) 2021 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
. ./common.python
status=1 # failure is the default!
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
# Something in pcp-ss is non-deterministic about how the
# output lines are ordered, so we have to sort 'em here.
# The first 2 lines are "heading", so keep them out of
# the sort.
#
_filter()
{
$PCP_AWK_PROG '
BEGIN { out = "head" }
NR == 3 { out = "body" }
{ print >"'$tmp'." out }'
cat $tmp.head
LC_COLLATE=POSIX sort $tmp.body
}
pcp_ss="$PCP_BINADM_DIR/pcp-ss"
test -x $pcp_ss || _notrun "No pcp-ss(1) installed"
# real QA test starts here
archive=$here/archives/pcp-ss
echo && echo pcp-ss output, at default offset
pcp -z -a $archive ss -oemitauO \
| _filter
echo && echo pcp-ss output, at 10s offset
pcp -z -S10s -a $archive ss -oemitauO \
| _filter
echo && echo pcp-ss output, at specific start time
pcp -z -S'@Fri Jun 18 13:33:39 2021' -a $archive ss -oemitauO \
| _filter
echo && echo pcp-ss output, at archive end
pcp -z -O-0 -a $archive ss -oemitauO \
| _filter
echo && echo check error handling when metrics not present. Note error is expected
pcp -z -O-0 -a $here/archives/pcp-mpstat ss 2>&1 | sed -e "s;$here/;;"
# success, all done
status=0
exit
|