Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 748
blob0209cca4062a473c156a8772999e87ec7e3015ac
1 #!/bin/sh
2 # PCP QA Test No. 748
3 # Check pmlogrewrite config for mysql pmda changes
5 # Copyright (c) 2013 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 [ -f ${PCP_PMDAS_DIR}/mysql/pmdamysql.pl ] || _notrun "mysql pmda not installed"
18 status=1 # failure is the default!
19 $sudo rm -rf $tmp.* $seq.full
20 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
22 # archive with the latest and greatest mysql pmda installed ...
23 # see archives/mk-mysql.sh for a recipe to recreate
25 NEWARCHIVE=archives/mysql-1
27 # real QA test starts here
28 cat >$tmp.config <<End-of-File
29 metric mysql.status.connections { sem -> instant units -> 0,0,0,0,0,0 }
30 metric mysql.status.uptime_since_flush_status { sem -> counter }
31 metric mysql.status.uptime { sem -> counter }
32 End-of-File
34 pmlogrewrite -c $tmp.config -w $NEWARCHIVE $tmp.old
36 pmlogrewrite -c $PCP_VAR_DIR/config/pmlogrewrite/mysql_migrate.conf -w $tmp.old $tmp.new
38 pmdumplog -a $tmp.old >$tmp.old.dump
39 pmdumplog -a $tmp.new >$tmp.new.dump
40 pmdumplog -a $NEWARCHIVE >$tmp.ref.dump
42 echo "old -> new changes"
43 diff -u $tmp.old.dump $tmp.new.dump | sed -e '/^---/d' -e '/^+++/d'
45 echo
46 echo "new -> ref changes ... expect none"
47 diff -u $tmp.new.dump $tmp.ref.dump | sed -e '/^---/d' -e '/^+++/d'
49 # success, all done
50 status=0
52 exit