summaryrefslogtreecommitdiff
path: root/qa/531
diff options
context:
space:
mode:
Diffstat (limited to 'qa/531')
-rwxr-xr-xqa/53159
1 files changed, 59 insertions, 0 deletions
diff --git a/qa/531 b/qa/531
new file mode 100755
index 0000000..dee36b0
--- /dev/null
+++ b/qa/531
@@ -0,0 +1,59 @@
+#!/bin/sh
+# PCP QA Test No. 531
+# Exercise inet socket open command in dbpmda
+#
+# Copyright (c) 2013 Red Hat.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+[ $PCP_VER -ge 3801 ] || _notrun "No dbpmda support for inet sockets"
+
+status=1 # failure is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+
+username=`id -u -n`
+port=`_get_port tcp 6161 6171`
+if [ -z "$port" ]
+then
+ echo "Arrggh ... no free TCP port in the range 6161 ... 6171"
+ netstat -an
+ exit
+fi
+
+_filter()
+{
+ tee -a $seq.full | \
+ sed \
+ -e "s/socket inet $port/socket inet PORT/g" \
+ -e "s/inet port $port/inet port PORT/g" \
+ -e "s/ value $pid/ value PID/g" \
+ | _filter_dumpresult
+}
+
+# real QA test starts here
+$PCP_PMDAS_DIR/sample/pmdasample -i $port -U $username -l $tmp.log &
+pid=$!
+echo "PMDA sample PID = $pid" > $seq.full
+sleep 2 # allow socket setup to occur
+
+dbpmda -n $PCP_PMDAS_DIR/sample/root -ie <<End-of-File 2>&1 | _filter
+open socket inet $port
+getdesc on
+desc sample.daemon_pid
+fetch sample.daemon_pid
+text sample.daemon_pid
+close
+End-of-File
+
+# success, all done
+status=0
+
+exit