pmrep: fix archive end time reporting
[pcp.git] / qa / 826
blobb6162e6dde5199c5b9ac02e1fc8753b3b6e1876f
1 #!/bin/sh
2 # PCP QA Test No. 826
3 # Exercise Linux PMDA NUMA memory metrics.
5 # Copyright (c) 2016 Red Hat.
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 [ $PCP_PLATFORM = linux ] || _notrun "Linux-specific memory metric testing"
18 config="$PCP_PMDAS_DIR/linux/bandwidth.conf"
20 _cleanup()
22 cd $here
23 $sudo rm -f "$config"
24 if [ -f "$config.$seq" ]
25 then
26 _restore_config "$config"
27 $sudo rm -f "$config.$seq"
29 rm -rf $tmp $tmp.*
32 status=1 # failure is the default!
33 $sudo rm -rf $tmp $tmp.* $seq.full
34 trap "_cleanup; exit \$status" 0 1 2 3 15
36 _filter()
38 sed \
39 -e "s,$PCP_PMDAS_DIR,PCP_PMDAS_DIR,g" \
40 #end
43 root=$tmp.root
44 export LINUX_STATSPATH=$root
45 pmda=$PCP_PMDAS_DIR/linux/pmda_linux.so,linux_init
46 local="-L -K clear -K add,60,$pmda"
48 # real QA test starts here
49 rm -fr $root
50 mkdir $root || _fail "temporary root already in use?"
51 cd $root
52 # For single node tests
53 tar xzf $here/linux/meminfo-root-001.tgz
55 [ -f "$config" ] && _save_config "$config"
56 echo "== Checking max metric value with no bandwidth.conf"
57 $sudo rm -f "$config"
58 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
59 echo
61 echo "== Checking max metric value with bad bandwidth.conf"
62 echo 'bad data' > $tmp.config
63 $sudo cp $tmp.config "$config"
64 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
65 echo
67 echo "== Checking max metric value on config file with new version"
68 echo 'Version:99' > $tmp.config
69 $sudo cp $tmp.config "$config"
70 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
71 echo
73 echo "== Checking max metric value with good bandwidth.conf"
74 echo 'Version:1.0' > $tmp.config
75 echo 'node0:1024' >> $tmp.config
76 $sudo cp $tmp.config "$config"
77 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
78 echo
80 # Multinode tests start here
81 tar xzf $here/linux/meminfo-root-002.tgz
83 echo "== Checking max metric value with multinode bandwidth.conf"
84 echo 'Version:1.0' > $tmp.config
85 echo 'node0:1024' >> $tmp.config
86 echo 'node1:1024' >> $tmp.config
87 $sudo cp $tmp.config "$config"
88 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
89 echo
91 echo "== Checking max metric value with one bad node in bandwidth.conf"
92 echo 'Version:1.0' > $tmp.config
93 echo 'node0:1024' >> $tmp.config
94 echo 'node11:8192' >> $tmp.config
95 $sudo cp $tmp.config "$config"
96 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
97 echo
99 echo "== Checking max metric value with multiple bad nodes in bandwidth.conf"
100 echo 'Version:1.0' > $tmp.config
101 echo 'xyz:1024' >> $tmp.config
102 echo 'abc:8192.444' >> $tmp.config
103 $sudo cp $tmp.config "$config"
104 pminfo $local -f mem.numa.max_bandwidth 2>&1 | _filter
105 echo
107 # success, all done
108 status=0
109 exit