3 # Check pmlogrewrite config for mysql pmda changes
5 # Copyright (c) 2013 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
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 }
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'
46 echo "new -> ref changes ... expect none"
47 diff -u $tmp.new.dump
$tmp.ref.dump |
sed -e '/^---/d' -e '/^+++/d'