summaryrefslogtreecommitdiff
path: root/qa/199
diff options
context:
space:
mode:
Diffstat (limited to 'qa/199')
-rwxr-xr-xqa/199215
1 files changed, 215 insertions, 0 deletions
diff --git a/qa/199 b/qa/199
new file mode 100755
index 0000000..6b018a1
--- /dev/null
+++ b/qa/199
@@ -0,0 +1,215 @@
+#! /bin/sh
+# PCP QA Test No. 199
+# check out trivial PMDA
+#
+# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard filters
+. ./common.product
+. ./common.filter
+. ./common.check
+
+signal=$PCP_BINADM_DIR/pmsignal
+status=1
+install_on_cleanup=false
+pminfo trivial >/dev/null 2>&1 && install_on_cleanup=true
+
+_cleanup()
+{
+
+ if $sudo make >$tmp.out 2>&1
+ then
+ :
+ else
+ cat $tmp.out
+ echo "Arrgh, cleanup make failed"
+ exit
+ fi
+
+ if diff $tmp.root $PCP_VAR_DIR/pmns/root >/dev/null 2>&1
+ then
+ :
+ else
+ [ -f $tmp.root ] && $sudo mv $tmp.root $PCP_VAR_DIR/pmns/root
+ fi
+
+ if diff $tmp.pmcd.conf $PCP_PMCDCONF_PATH > /dev/null 2>&1
+ then
+ :
+ else
+
+
+ if $install_on_cleanup
+ then
+# do a default install which ensures the pmns and any views are installed
+ $sudo ./Install </dev/null >/dev/null 2>&1
+ else
+# leave the landscape clean like you found it
+ $sudo ./Remove >/dev/null 2>&1
+ fi
+
+# PMDA may have been installed differently to default. As everything is
+# installed we can use the old pmcd.conf file to restore state.
+
+ if diff $tmp.pmcd.conf $PCP_PMCDCONF_PATH > /dev/null 2>&1
+ then
+ :
+ else
+ [ -f $tmp.pmcd.conf ] && $sudo mv $tmp.pmcd.conf $PCP_PMCDCONF_PATH
+ $sudo $signal -a -s HUP pmcd
+ fi
+ fi
+
+ rm -f $tmp.*
+ exit $status
+}
+
+trap "_cleanup" 0 1 2 3 15
+
+_filter()
+{
+ _filter_pmda_install
+}
+
+# real QA test starts here
+home=$PCP_PMDAS_DIR
+iam=trivial
+if [ ! -d $home/$iam ]
+then
+ echo "Where is $home/$iam?"
+ exit 1
+fi
+cd $home/$iam
+unset ROOT MAKEFLAGS
+
+# copy some config file to restore state later.
+cp $PCP_PMCDCONF_PATH $tmp.pmcd.conf
+cp $PCP_VAR_DIR/pmns/root $tmp.root
+
+if $sudo make clobber >$tmp.out 2>&1
+then
+ :
+else
+ cat $tmp.out
+ echo "Arrgh, make clobber failed"
+ exit
+fi
+
+if $sudo make >$tmp.out 2>&1
+then
+ :
+else
+ cat $tmp.out
+ echo "Arrgh, make failed"
+ exit
+fi
+
+# start from a known starting point
+$sudo ./Remove >/dev/null 2>&1
+
+echo
+echo "=== pipe daemon agent ==="
+$sudo ./Remove >$tmp.out 2>&1
+echo 'both
+daemon
+pipe' | $sudo ./Install >>$tmp.out 2>&1
+
+_filter <$tmp.out
+
+if pminfo -v trivial
+then
+ :
+else
+ echo "... failed! ... here is the Install log ..."
+ cat $tmp.out
+fi
+
+echo
+echo "=== Unix socket daemon agent ==="
+$sudo ./Remove >$tmp.out 2>&1
+echo 'both
+daemon
+socket
+Unix
+'"$tmp.fifo" | $sudo ./Install >>$tmp.out 2>&1
+echo 'both
+daemon
+socket
+Unix
+'"$tmp.fifo" | $sudo ./Install >>$tmp.out 2>&1
+
+_filter <$tmp.out
+
+if pminfo -v trivial
+then
+ :
+else
+ echo "... failed! ... here is the Install log ..."
+ cat $tmp.out
+fi
+
+echo
+echo "=== Internet socket daemon agent ==="
+$sudo ./Remove >$tmp.out 2>&1
+
+# pick a tcp port that is not in use
+#
+port=`_get_port tcp 5670 5689`
+if [ -z "$port" ]
+then
+ echo "Arrgh ... no free TCP port in the range 5670 ... 5689"
+ exit 1
+fi
+
+echo 'both
+daemon
+socket
+Internet
+'$port | $sudo ./Install >>$tmp.out 2>&1
+
+# use next port this time
+port=`expr $port + 1`
+
+echo 'both
+daemon
+socket
+Internet
+'$port | $sudo ./Install >>$tmp.out 2>&1
+
+_filter <$tmp.out
+
+if pminfo -v trivial
+then
+ :
+else
+ echo "... failed! ... here is the Install log ..."
+ cat $tmp.out
+fi
+
+echo
+echo "=== dso agent ==="
+$sudo ./Remove >$tmp.out 2>&1
+echo 'both
+dso' | $sudo ./Install >>$tmp.out 2>&1
+echo 'both
+dso' | $sudo ./Install >>$tmp.out 2>&1
+
+_filter <$tmp.out
+
+if pminfo -v trivial
+then
+ :
+else
+ echo "... failed! ... here is the Install log ..."
+ cat $tmp.out
+fi
+
+$sudo ./Remove >$tmp.out 2>&1
+_filter <$tmp.out
+
+status=0
+exit