3 # Exercise the Install/Remove for the news PMDA
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
16 [ -d $PCP_PMDAS_DIR/news
] || _notrun
"news PMDA directory is not installed"
18 perl
-e "use PCP::PMDA" >/dev
/null
2>&1
19 test $?
-eq 0 || _notrun
"PCP::PMDA perl module is not installed"
30 if [ -f $tmp.pmcd.conf
]
32 $sudo cp $tmp.pmcd.conf
$PCP_PMCDCONF_PATH
36 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
39 if $install_on_cleanup
41 ( cd $PCP_PMDAS_DIR/news
; $sudo .
/Install
</dev
/null
>/dev
/null
2>&1 )
43 ( cd $PCP_PMDAS_DIR/news
; $sudo .
/Remove
</dev
/null
>/dev
/null
2>&1 )
50 install_on_cleanup
=false
51 pminfo news
>/dev
/null
2>&1 && install_on_cleanup
=true
53 trap "_cleanup" 0 1 2 3 15
57 _filter_pmda_install | \
58 sed -e 's/^Install news as a daemon or perl agent? \[daemon] //'
64 -e 's/value -[0-9][0-9]*\.[0-9]*/value NEGATIVE NUMBER/' \
65 -e 's/value -[0-9][0-9]*/value NEGATIVE NUMBER/' \
66 -e 's/value [0-9][0-9]*\.[0-9]*/value NUMBER/' \
67 -e 's/value [0-9][0-9]*/value NUMBER/'
70 # real QA test starts here
73 if [ ! -d $home/$iam ]
75 echo "Where is $home/$iam?"
81 # copy the pmcd config file to restore state later.
82 cp $PCP_PMCDCONF_PATH $tmp.pmcd.conf
84 # start from a known starting point
85 $sudo .
/Remove
>/dev
/null
2>&1
87 # now that pmcd is also known to be alive, give the news PMDA
88 # a bit more breathing space to respond
90 pmstore pmcd.control.timeout
20 >/dev
/null
2>&1
91 PMCD_REQUEST_TIMEOUT
=25
92 export PMCD_REQUEST_TIMEOUT
95 echo "=== default $iam agent installation ==="
96 $sudo .
/Remove
>$tmp.out
2>&1
98 $sudo .
/Install
</dev
/null
>>$tmp.out
2>&1
105 echo "... failed! ... here is the Install log ..."
110 echo "=== validate values ==="
111 pminfo
-f `pminfo $iam | LC_COLLATE=POSIX sort` >$tmp.out
112 _filter_info
<$tmp.out
114 if fgrep
-s "No PMCD agent" $tmp.out
>/dev
/null
2>&1
120 cat $PCP_PMCDLOG_PATH
123 if [ -d $PCP_LOG_DIR/pmcd
]
125 cat $PCP_LOG_DIR/pmcd
/news.log
127 cat $PCP_LOG_DIR/news.log
132 echo "=== remove $iam agent ==="
133 $sudo .
/Remove
>$tmp.out
2>&1
138 pmstore pmcd.control.timeout
5 >/dev
/null
2>&1