summaryrefslogtreecommitdiff
path: root/qa/897
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
commit47e6e7c84f008a53061e661f31ae96629bc694ef (patch)
tree648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/897
downloadpcp-debian.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/897')
-rwxr-xr-xqa/89780
1 files changed, 80 insertions, 0 deletions
diff --git a/qa/897 b/qa/897
new file mode 100755
index 0000000..754d9ee
--- /dev/null
+++ b/qa/897
@@ -0,0 +1,80 @@
+#!/bin/sh
+# PCP QA Test No. 897
+# pmlc/pmlogger access control compatibility
+#
+# Copyright (c) 2014 Ken McDonell. All Rights Reserved.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+status=1 # failure is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "cd $here; $sudo rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+
+hostname=`hostname`
+
+_filter()
+{
+ sed \
+ -e "s/^connect $pid/connect QA_LOGGER_PID/" \
+ -e "s/^pmlogger \[$pid]/pmlogger [QA_LOGGER_PID]/" \
+ -e "s/from host $hostname/from host HOST/" \
+ -e "s/\(The following pmloggers .* on \)$hostname/\1HOST/" \
+ -e '/primary (/s/([0-9][0-9]*).*/(LOGGER_PID) .../' \
+ -e '/^PMCD host/s/\( *\).*/\1HOST/' \
+ -e 's/^\(log started *\).*/\1DATESTAMP/' \
+ -e 's/^\(last log entry *\).*/\1DATESTAMP/' \
+ -e '/^current time/s/\( *\).*/\1DATE/' \
+ -e '/^log volume/s/\( *\).*/\1NUMBER/' \
+ -e '/^log size/s/\( *\).*/\1NUMBER/' \
+
+}
+
+# real QA test starts here
+for acl in enquire advisory mandatory \
+ 'enquire,advisory' 'enquire,mandatory' 'advisory,mandatory' \
+ 'enquire,advisory,mandatory'
+do
+ echo | tee -a $seq.full
+ echo "=== allow * : $acl ===" | tee -a $seq.full
+ cat <<End-of-File >$tmp.config
+log mandatory on once { sample.bin }
+
+[access]
+disallow * : all;
+allow localhost : $acl;
+End-of-File
+
+ $sudo rm -f $tmp.[0-9]* $tmp.index $tmp.meta $tmp.log
+ # Note: _start_up_pmlogger returns with $pid set
+ #
+ _start_up_pmlogger -L -c $tmp.config -l $tmp.log $tmp
+ _wait_for_pmlogger $pid $tmp.log
+ cat <<End-of-File | pmlc -e 2>&1 | tee -a $seq.full | _filter
+show loggers
+connect $pid
+status
+query { sample.colour sample.long.one }
+# need mandatory
+flush
+new volume
+log advisory on 5sec sample.long.one
+log mandatory off sample.colour
+# check
+query { sample.colour sample.long.one }
+End-of-File
+ $sudo kill -TERM $pid
+ wait
+ cat $tmp.log >>$seq.full
+done
+
+# success, all done
+status=0
+
+exit