3 # Exercise Linux PMDA NUMA memory metrics.
5 # Copyright (c) 2016 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ $PCP_PLATFORM = linux
] || _notrun
"Linux-specific memory metric testing"
18 config
="$PCP_PMDAS_DIR/linux/bandwidth.conf"
24 if [ -f "$config.$seq" ]
26 _restore_config
"$config"
27 $sudo rm -f "$config.$seq"
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
39 -e "s,$PCP_PMDAS_DIR,PCP_PMDAS_DIR,g" \
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
50 mkdir
$root || _fail
"temporary root already in use?"
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"
58 pminfo
$local -f mem.numa.max_bandwidth
2>&1 | _filter
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
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
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
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
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
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