This file is indexed.

/var/lib/pcp/testsuite/325 is in pcp-testsuite 3.8.12ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
#! /bin/sh
# PCP QA Test No. 325
# pmprintf checks
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

. ./common.product
. ./common.check
. ./common.config

which pmconfirm >/dev/null 2>&1 || _notrun pmconfirm not installed
which xdpyinfo >/dev/null 2>&1
if test $? -eq 0; then
    DISPLAY=$PCPQA_CLOSE_X_SERVER xdpyinfo >/dev/null 2>&1 || \
	_notrun "Failed sanity check on DISPLAY $PCPQA_CLOSE_X_SERVER"
fi


_cleanup()
{
    echo "at end ..." >>$seq.full
    pid=`ps $PCP_PS_ALL_FLAGS | egrep '[p]mconfirm' | tee -a $seq.full | $PCP_AWK_PROG '{print $2}'`
    echo "[p]mconfirm pid: $pid" >>$seq.full
    [ -n "$pid" ] && $signal -s KILL $pid >/dev/null 2>&1
    pid=`ps $PCP_PS_ALL_FLAGS | egrep '[p]mprintf' | tee -a $seq.full | $PCP_AWK_PROG '{print $2}'`
    echo "[p]mprintf pid: $pid" >>$seq.full
    [ -n "$pid" ] && $signal -s KILL $pid >/dev/null 2>&1
    pid=`ps $PCP_PS_ALL_FLAGS | egrep '[p]mquery' | tee -a $seq.full | $PCP_AWK_PROG '{print $2}'`
    echo "[p]mquery pid: $pid" >>$seq.full >/dev/null 2>&1
    [ -n "$pid" ] && $signal -s KILL $pid
    rm -f $tmp.*
}

_countem()
{
    $PCP_PS_PROG $PCP_PS_ALL_FLAGS \
	| grep $PCP_XCONFIRM_PROG | grep -v grep \
	| tee -a $seq.full \
	> $tmp.count
    cat $tmp.count | wc -l | tr -d ' '
}

tmp=/tmp/$$
signal=$PCP_BINADM_DIR/pmsignal
status=1	# failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $seq.full

# real QA test starts here

echo "initially ..." >$seq.full
OLDXCONFIRMCNT=`_countem`

# Expect something on stderr
unset PCP_STDERR
src/pmprintf foo bee doo

# Expect something in an xconfirm
export DISPLAY=$PCPQA_CLOSE_X_SERVER
echo "DISPLAY=$DISPLAY" >>$seq.full
export PCP_STDERR=DISPLAY
if [ -z "$PCP_XCONFIRM_PROG" ]
then
    echo 'Error: $PCP_XCONFIRM_PROG not set'
    exit $status
fi

(src/pmprintf some invisible text &)2>$tmp.err
# wait for dialog to fire up
sleep 3
rm -f $tmp.out
echo "after start up ..." >>$seq.full
XCONFIRMCNT=`_countem`

if [ $XCONFIRMCNT -gt $OLDXCONFIRMCNT ]
then
     echo '=== $PCP_XCONFIRM_PROG started OK ==='
else
     echo "=== Urk, no change in number of $PCP_XCONFIRM_PROG - $XCONFIRMCNT ==="
     cat $tmp.count
     echo
     echo "Errors from src/pmprintf?"
     cat $tmp.err
fi

# Expect something in file
[ -f  $tmp.pmprintf ] && rm -f $tmp.pmprintf
PCP_STDERR=$tmp.pmprintf
export PCP_STDERR
src/pmprintf sent all this text to a file
src/pmprintf and this too
cat $tmp.pmprintf
rm -f $tmp.pmprintf

# success, all done
status=0
exit