Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 831
blobacc09c2910f9f26333e1565b9f7b77dd379edf6f
1 #!/bin/sh
2 # PCP QA Test No. 831
3 # Exercising local socket connections and user credentials.
5 # Approach used is to enable tracing in the sample PMDA and
6 # then access (any) sample metric. This should result in a
7 # log message in pmdasample.log reflecting the testers user
8 # and group identifiers.
10 # Copyright (c) 2013 Red Hat.
13 seq=`basename $0`
14 echo "QA output created by $seq"
16 # get standard environment, filters and checks
17 . ./common.secure
19 _get_libpcp_config
20 $unix_domain_sockets || _notrun "No unix domain socket support available"
21 $authentication || _notrun "No authentication support available"
23 status=1 # failure is the default!
24 $sudo rm -rf $tmp.* $seq.full
25 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
27 # real QA test starts here
28 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
29 _wait_for_pmcd # sample.log is now sure to be clean
31 echo "Enabling sample PMDA tracing"
32 authdbg=`pmdbg -l | grep DBG_TRACE_AUTH | awk '{ print $2 }'`
33 pmstore sample.control $authdbg
35 echo "Verifying authentication for new client"
36 pmprobe -v -h unix: sample.control
37 filter_sample_log_credentials
39 echo "Resetting sample PMDA tracing"
40 pmstore -h unix: sample.control 0
41 filter_sample_log_credentials
43 # success, all done
44 status=0
45 exit