3 # Test libpcp multi-archive support using pmclient_fg
5 # Copyright (c) 2016 Red Hat. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
17 $multi_archive_contexts || _notrun
"Multi-archive support is not available"
19 status
=1 # failure is the default!
20 $sudo rm -rf $tmp $tmp.
* $seq.full
21 trap "cd $here; rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
26 sed -e 's/^Archive:.* Host:/ARCHIVE: Host:/' \
30 # real QA test starts here
33 mkdir
-p $tmp.archives
35 # Check that running pmstat on a set of archives performs identically
36 # to running it on the archive created by combining those same archives
39 # First, run pmlogextract against the archives.
40 IN
="$DIR/20150508.11.44 $DIR/20150508.11.46 $DIR/20150508.11.50 $DIR/20150508.11.57"
41 OUT
=$tmp.44+46+50+57.pmlogextract
43 echo "Running pmlogextract $IN $OUT" | _filter |
tee $seq.full
44 pmlogextract
$IN $OUT 2>&1 >> $seq.full
45 [ $?
-eq 0 ] ||
echo "Error running pmlogextract $IN $OUT -- see $seq.full"
47 # Now run pmstat against the extracted archive.
49 OUTBASE
=$OUT.
$TOOL.txt
50 echo "Running $TOOL -z -a $IN" | _filter
51 $TOOL -z -a $IN 2>&1 | _filter |
tee $OUTBASE
53 # Now, run pmstat against the set of archives.
54 IN
=$DIR/20150508.11.44,$DIR/20150508.11.46,$DIR/20150508.11.50,$DIR/20150508.11.57
55 OUT
=$tmp.44+46+50+57.
$TOOL.txt
56 echo "Running $TOOL -z -a $IN" | _filter
57 $TOOL -z -a $IN 2>&1 | _filter |
tee $OUT
59 # Make sure the output is the same
60 echo "Running diff $OUTBASE $OUT" | _filter |
tee -a $seq.full
61 diff $OUTBASE $OUT 2>&1 >> $seq.full
62 [ $?
-eq 0 ] ||
echo "$OUT differs from $OUTBASE -- see $seq.full"
64 # Now do it again, specifying the set of archives using the directory name
66 OUT
=$tmp.
$DIR.
$TOOL.txt
67 echo "Running $TOOL -z -a $IN" | _filter
68 $TOOL -z -a $IN 2>&1 | _filter |
tee $OUT
70 # Make sure the output is the same
71 echo "Running diff $OUTBASE $OUT" | _filter |
tee -a $seq.full
72 diff $OUTBASE $OUT 2>&1 >> $seq.full
73 [ $?
-eq 0 ] ||
echo "$OUT differs from $OUTBASE -- see $seq.full"