3 # pmdatrace and libpcp_trace reconnect test
5 # Copyright (c) 2015 Red Hat.
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
17 [ -f $PCP_PMDAS_DIR/trace
/pmdatrace
] || _notrun
"trace pmda not installed"
19 signal
=$PCP_BINADM_DIR/pmsignal
29 if [ -d $PCP_LOG_DIR/pmlogger
]
31 LOGGING_DIR
=$PCP_LOG_DIR/pmlogger
33 LOGGING_DIR
=$PCP_LOG_DIR
41 pmafm
$LOGGING_DIR/$LOCALHOST/Latest remove
>$tmp.cmd
2>&1 \
43 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
46 if $install_on_cleanup
48 ( cd $PCP_PMDAS_DIR/trace
; $sudo .
/Install
</dev
/null
>/dev
/null
2>&1 )
50 ( cd $PCP_PMDAS_DIR/trace
; $sudo .
/Remove
</dev
/null
>/dev
/null
2>&1 )
54 if [ -n "$savedtracehost" ]
56 PCP_TRACE_HOST
=$savedtracehost; export PCP_TRACE_HOST
62 _change_config pmlogger on
63 _change_config pmcd on
65 install_on_cleanup
=false
66 pminfo trace
>/dev
/null
2>&1 && install_on_cleanup
=true
69 trap "_interrupt; _cleanup" 1 2 3 15
71 if [ -n "$PCP_TRACE_HOST" ]
73 savedtracehost
=$PCP_TRACE_HOST; unset PCP_TRACE_HOST
76 # real QA test starts here
78 cd $PCP_PMDAS_DIR/trace
79 $sudo .
/Install
-R / </dev
/null
>/dev
/null
2>&1
82 cd $PCP_DEMOS_DIR/trace
83 $sudo make app2
2>&1 >$tmp.
make
86 echo app2 programs
make failed. Heres the
make output ...
92 # Allow app2 to reconnect asap
95 export PCP_TRACE_RECONNECT
97 ( ( $PCP_DEMOS_DIR/trace
/app2
>/dev
/null
2>&1 & ) )
99 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
102 # time_sucker transaction sleeps for 10 secs - wait for this
104 vals
=`pminfo -f trace.transact.count | fgrep 'No value(s) available!' | wc -l`
107 echo "Error: No value(s) available!"
109 echo "Reconnect succeeded."
113 $signal -a -s KILL app2
2>&1 >/dev
/null
115 # xcheck observe problem where value of second observation of same tag
116 # gives first calls value.
118 echo "=== Checking observed value matches latest call ==="
120 # these values are deteministic
121 pminfo
-f trace.observe.count trace.observe.value