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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
#!/bin/sh
# PCP QA Test No. 560
# #681487 error handling in pmdaproc.sh dialogs
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
[ -d $PCP_PMDAS_DIR/simple ] || _notrun "simple PMDA directory is not installed"
status=1 # failure is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
echo "PCPQA_IN_CI=$PCPQA_IN_CI" >>$seq_full
if [ "$PCPQA_IN_CI" = yes ]
then
# in CI
# failing on test-ubuntu1804i386-container and nowhere else ...
# despite extensive triage, tcp port "already in use" problem
# persists
#
eval `src/sizeof ptr`
echo "ptr=$ptr" >>$seq_full
if [ "$ptr" = 4 ]
then
admin/whatami >>$seq_full
# 32-bit platform
case `admin/whatami`
in
*Ubuntu\ 18.04\ *)
# bingo ... no cigar
_notrun "cannot make this test work for test-ubuntu1804i386-container"
;;
esac
fi
fi
# real QA test starts here
cd $PCP_PMDAS_DIR/simple
unset ROOT MAKEFLAGS
$sudo $PCP_MAKE_PROG clobber >>$seq_full 2>&1
$sudo $PCP_MAKE_PROG >>$seq_full 2>&1
_filter_make()
{
sed \
-e '/In function .vpmprintf./d' \
-e '/warning: the use of .tempnam./d' \
-e '/make: Nothing to be done/d'
}
# see note below on bind: Address already in use issue
#
port=`_get_port tcp 52078 52127`
if [ -z "$port" ]
then
echo "Arrgh ... no free TCP port in the range 52078 ... 52127"
exit
fi
echo "port=$port" >>$seq_full
echo "hostname: `hostname`" >>$seq_full
$sudo fuser tcp/$port >>$seq_full 2>&1
cat <<End-of-File | $sudo ./Install -e >$tmp.out 2>&1
foo
daemon
foo
socket
foo
Unix
Internet
$port
End-of-File
tee -a $seq_full <$tmp.out \
| sed \
-e "s/ $port\$/ PORT/" \
-e 's/or perl //g' \
-e 's/or python //g' \
-e 's/daemon or dso,/"daemon" or "dso",/g' \
| _filter_pmda_install \
| _filter_make
echo "in \$PCP_PMCDCONF_PATH ..."
sed -n <$PCP_PMCDCONF_PATH \
-e '/^simple/{
s;/private/;/;
s;'"$PCP_PMDAS_DIR"';$PCP_PMDAS_DIR;
s/$/ /
s/\([ ]\)'"$port"'\([ ]\)/\1PORT\2/g
s/ $//
p
}'
if [ -f "$PCP_LOG_DIR/pmcd/simple.log" ]
then
cat "$PCP_LOG_DIR/pmcd/simple.log" >>$seq_full
else
echo "$PCP_LOG_DIR/pmcd/simple.log: missing?"
fi
pminfo -f simple pmcd.agent.status >>$seq_full
$sudo ./Remove
# need to be sure these back-to-back installs use a different
# port ... otherwise the second install risks smacking into a
# "bind: Address already in use" issue if the previous PMDA
# process has not cleaned up ... this is why the first install
# uses a port in the range starting at 5000+2078, so the second
# install below can use the default 2078 port
#
echo
if $sudo $PCP_MAKE_PROG >$tmp.tmp 2>$tmp.err
then
cat $tmp.err | _filter_make
else
cat $tmp.tmp
echo "make prior to Install failed!"
fi
$sudo ./Install </dev/null >$tmp.out 2>&1
tee -a $seq_full <$tmp.out \
| grep 'Check'
if [ -f "$PCP_LOG_DIR/pmcd/simple.log" ]
then
cat "$PCP_LOG_DIR/pmcd/simple.log" >>$seq_full
else
echo "$PCP_LOG_DIR/pmcd/simple.log: missing?"
fi
pminfo -f simple pmcd.agent.status >>$seq_full
# success, all done
status=0
exit
|