2 # PCP QA Test No. 1045 (formerly 526)
3 # exercise pmieconf version control (pmie config/rules)
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 which pmieconf
>/dev
/null
2>&1 || _notrun
"No pmieconf binary installed"
21 # ctime format: Thu Dec 17 15:26:15 1998
22 sed -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]/[DATE]/g' \
23 -e "s@$PCP_BINADM_DIR/pmpost@pmpost@"
28 if [ $PCP_PLATFORM = darwin
]
31 -e '/metric swap.pagesout not in namespace/d' \
32 -e '/pmLookupName failed: Unknown metric name/d'
33 elif [ $PCP_PLATFORM = solaris
]
36 -e '/metric swap.pagesout not in namespace/d' \
37 -e '/metric filesys.used not in namespace/d' \
38 -e '/metric filesys.capacity not in namespace/d' \
39 -e '/metric filesys.used not in namespace/d' \
40 -e '/pmLookupName failed: Unknown metric name/d'
46 status
=1 # failure is the default!
47 $sudo rm -f $tmp.
* $seq.full
48 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
50 # real QA test starts here
52 // pmieconf-pmie 0 ./pconf
56 echo "=== check unsupported pmie config version"
57 pmieconf
-F -r .
/pconf
-f $tmp.pmie
2>$tmp.stderr
58 sed -e "s/$seq-$$/[SEQ-PID]/g" $tmp.stderr
62 // pmieconf-pmie 1 ./pconf
63 // 1 filesys.buffer_cache threshold = 81.500%
64 // 1 filesys.buffer_cache hosts = "moomba wobbly"
65 // 1 filesys.buffer_cache sss_action = yes
66 // 1 filesys.buffer_cache user_command = "$PCP_BINADM_DIR/pmpost \$rule\$^ %v@%h"
67 // 1 filesys.buffer_cache holdoff = 20
68 // 2 filesys.buffer_cache holdoff = 20
69 // 2 filesys.buffer_cache delta = 1908
70 // 3 filesys.buffer_cache enabled = yes
71 // 1 filesys.capacity delta = 60
72 // 1 network.interface_bytes holdoff = 30
73 // 1 network.tcp_dropped_conns holdoff = 30
74 // 1 network.tcp_retransmit holdoff = 30
77 // 1 cpu.aggregate_util
83 // 1 filesys.buffer_cache
86 cp $tmp.pmie
$tmp.pmie1
89 echo "=== check that unneeded changes for unsupported versions are dumped"
90 pmieconf
-r .
/pconf
-f $tmp.pmie1 m filesys.buffer_cache sss_action no
>/dev
/null
92 pmie
-C $tmp.pmie1
>$tmp.out
2>&1
94 _filter_pmie
<$tmp.out
96 _filter_date
< $tmp.pmie1
98 # APPEND this to the above file
99 cat >> $tmp.pmie
<<EOF
100 // 2 filesys.buffer_cache
105 cp $tmp.pmie
$tmp.pmie2
108 echo "=== check that changes for unsupported versions are moved to end"
109 pmieconf
-r .
/pconf
-f $tmp.pmie2 m network.interface_bytes holdoff
40 >/dev
/null
111 pmie
-C $tmp.pmie2
>$tmp.out
2>&1
113 _filter_pmie
<$tmp.out
115 _filter_date
< $tmp.pmie2
117 cp $tmp.pmie
$tmp.pmie3
118 ( echo "before pmieconf"; ( [ -f .
/pconf
/cpu
/load_average
] && ls -l .
/pconf
/cpu
/load_average
) ) >>$seq.full
119 $sudo mv .
/pconf
/cpu
/load_average
$tmp.load
121 echo "=== check that changes for unsupported rules are moved to end"
122 pmieconf
-r .
/pconf
-f $tmp.pmie3 m filesys.buffer_cache holdoff
120 >/dev
/null
123 ( echo "after pmieconf"; ( [ -f .
/pconf
/cpu
/load_average
] && ls -l .
/pconf
/cpu
/load_average
) ) >>$seq.full
124 $sudo mv $tmp.load .
/pconf
/cpu
/load_average
125 ( echo "after restore"; ( [ -f .
/pconf
/cpu
/load_average
] && ls -l .
/pconf
/cpu
/load_average
) ) >>$seq.full
127 pmie
-C $tmp.pmie3
>$tmp.out
2>&1
129 _filter_pmie
<$tmp.out
131 _filter_date
< $tmp.pmie3
133 # debug check ... someone's clobbering pconf
135 if `which git >/dev/null 2>&1`
137 if git config
--get remote.origin.url
>/dev
/null
139 # assume we're in a git repository, but may be older version of
140 # git (so -s does not work)
141 git status |
grep pconf