3 # Check log rewriting of Linux /proc/net/snmp metric types
5 # Copyright (c) 2013, 2015 Red Hat.
8 # get standard environment, filters and checks
14 echo "QA output created by $seq"
16 [ -f ${PCP_PMDAS_DIR}/snmp
/pmdasnmp.pl
] || _notrun
"snmp 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 migrate
=$PCP_VAR_DIR/config
/pmlogrewrite
/linux_proc_net_snmp_migrate.conf
23 [ -f "$migrate" ] || _notrun
"$migrate not installed"
25 # real QA test starts here
26 cat >$tmp.config
<<End-of-File
27 metric 60.14.* { type -> U32 }
30 pmlogrewrite
-c $tmp.config
-w archives
/new_snmp
$tmp.old
32 pmlogrewrite
-c $migrate -w $tmp.old
$tmp.new
34 pmdumplog
-z -a $tmp.old
>$tmp.old.dump
35 pmdumplog
-z -a $tmp.new
>$tmp.new.dump
36 pmdumplog
-z -a archives
/new_snmp
>$tmp.ref.dump
38 echo "old -> new changes"
39 diff -u $tmp.old.dump
$tmp.new.dump |
sed -e '/^---/d' -e '/^+++/d'
42 echo "new -> ref changes ... expect none"
43 diff -u $tmp.new.dump
$tmp.ref.dump |
sed -e '/^---/d' -e '/^+++/d'