File: 533

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (63 lines) | stat: -rwxr-xr-x 1,363 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
# PCP QA Test No. 533
# Exercise ipv6 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

_get_libpcp_config
$ipv6 || _notrun "No IPv6 support, so cannot test dbpmda IPv6 support"

status=1	# failure is the default!
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15

username=`id -u -n`
port=`_get_port tcp 6261 6271`
if [ -z "$port" ]
then
    echo "Arrggh ... no free TCP port in the range 6261 ... 6271"
    netstat -an
    exit
fi

_filter()
{
    tee -a $seq_full | \
    sed \
        -e "s/socket ipv6 $port/socket ipv6 PORT/g" \
        -e "s/ipv6 port $port/ipv6 port PORT/g" \
        -e "s/   value $pid/   value PID/g" \
    | _filter_dumpresult
}

# real QA test starts here
$PCP_PMDAS_DIR/sample/pmdasample -Dcontext,desperate -6 $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 ipv6 $port
getdesc on
desc sample.daemon_pid
fetch sample.daemon_pid
text sample.daemon_pid
close
End-of-File

echo >>$seq_full
echo "=== sample pmda log ===" >>$seq_full
cat $tmp.log >>$seq_full

# success, all done
status=0

exit