diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
commit | 47e6e7c84f008a53061e661f31ae96629bc694ef (patch) | |
tree | 648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/src/mkbig1 | |
download | pcp-debian.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/src/mkbig1')
-rwxr-xr-x | qa/src/mkbig1 | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/qa/src/mkbig1 b/qa/src/mkbig1 new file mode 100755 index 0000000..3c35faf --- /dev/null +++ b/qa/src/mkbig1 @@ -0,0 +1,78 @@ +#!/bin/sh +# +# remake the big1 archive. +# Needs a lot of disk space, so is guarded by df check ... output +# archive is used by multiple tests. If return code is non-zero, +# then output is suitable for a notrun message. +# +# Copyright (c) 2012 Red Hat. +# Copyright (c) 2011 Ken McDonell. All Rights Reserved. +# + +[ -f ../common.rc ] && cd .. # from src directory +. ./common.rc # for $sudo, $tmp, $here and pcp.env +. ./common.check + +# cleanup any archives in the old location (not src) +$sudo rm -f big1.* + +# don't recreate the archive unless we really have to +[ -s src/big1.0 -a -s src/big1.1 -a -s src/big1.index -a -s src/big1.meta ] && exit 0 + +# 10GB should keep us out of trouble +free=`_check_freespace 10240` +if [ -n "$free" ] +then + echo $free + exit 1 +fi + +status=1 +iam=mkbig1 +$sudo rm -rf $tmp.* +trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + if [ ! -f $tmp.done ] + then + cd $here/pmdas/bigun + $sudo ./Remove >>$here/src/$iam.log + cd $here + touch $tmp.done + fi +} + +cd $here/pmdas/bigun +make >$here/src/$iam.log 2>&1 +$sudo ./Install </dev/null >>$here/src/$iam.log +if [ $? != 0 ] +then + echo "bigun pmda Install failed ... see $here/src/$iam.log" + exit +fi +if pmprobe bigun 2>&1 | tee -a $here/src/$iam.log | grep ' [0-9]$' +then + : +else + echo "bigun pmda Install failed ... see $here/src/$iam.log" + exit +fi +cd $here + +cat <<End-of-File >$tmp.config +log mandatory on default { + bigun + sample.hordes +} +End-of-File + +$sudo rm -f big1.* +pmlogger -r -c $tmp.config -l $tmp.out -t 10msec -s 2049 src/big1 +echo >>$here/src/$iam.log +cat $tmp.out >>$here/src/$iam.log +echo >>$here/src/$iam.log +ls -l src/big1.* >>$here/src/$iam.log + +status=0 +exit |