This file is indexed.

/var/lib/pcp/testsuite/1045 is in pcp-testsuite 3.9.10.

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
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
#! /bin/sh
# PCP QA Test No. 1045 (formerly 526)
# exercise pmieconf version control (pmie config/rules)
#
#
# 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

which pmieconf >/dev/null 2>&1 || _notrun "No pmieconf binary installed"

_filter_date()
{
    # ctime format: Thu Dec 17 15:26:15 1998
    sed -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]/[DATE]/g' \
        -e "s@$PCP_BINADM_DIR/pmpost@pmpost@"
}

_filter_pmie()
{
    if [ $PCP_PLATFORM = darwin ]
    then
	sed \
	    -e '/metric swap.pagesout not in namespace/d' \
	    -e '/pmLookupName failed: Unknown metric name/d'
    elif [ $PCP_PLATFORM = solaris ]
    then
	sed \
	    -e '/metric swap.pagesout not in namespace/d' \
	    -e '/metric filesys.used not in namespace/d' \
	    -e '/metric filesys.capacity not in namespace/d' \
	    -e '/metric filesys.used not in namespace/d' \
	    -e '/pmLookupName failed: Unknown metric name/d'
    else
	cat
    fi
}

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

# real QA test starts here
cat > $tmp.pmie <<EOF
// pmieconf-pmie 0 ./pconf
// end
EOF
echo
echo "=== check unsupported pmie config  version"
pmieconf -F -r ./pconf -f $tmp.pmie 2>$tmp.stderr
sed -e "s/$seq-$$/[SEQ-PID]/g" $tmp.stderr
echo status=$?

cat > $tmp.pmie <<EOF
// pmieconf-pmie 1 ./pconf
// 1 filesys.buffer_cache threshold = 81.500%
// 1 filesys.buffer_cache hosts = "moomba wobbly"
// 1 filesys.buffer_cache sss_action = yes
// 1 filesys.buffer_cache user_command = "$PCP_BINADM_DIR/pmpost \$rule\$^ %v@%h"
// 1 filesys.buffer_cache holdoff = 20
// 2 filesys.buffer_cache holdoff = 20
// 2 filesys.buffer_cache delta = 1908
// 3 filesys.buffer_cache enabled = yes
// 1 filesys.capacity delta = 60
// 1 network.interface_bytes holdoff = 30
// 1 network.tcp_dropped_conns holdoff = 30
// 1 network.tcp_retransmit holdoff = 30
// end

// 1 cpu.aggregate_util
sample.float.one;

// 1 cpu.load_average
sample.float.ten;

// 1 filesys.buffer_cache
sample.float.hundred;
EOF
cp $tmp.pmie $tmp.pmie1

echo
echo "=== check that unneeded changes for unsupported versions are dumped"
pmieconf -r ./pconf -f $tmp.pmie1 m filesys.buffer_cache sss_action no >/dev/null
echo status=$?
pmie -C $tmp.pmie1 >$tmp.out 2>&1
sts=$?
_filter_pmie <$tmp.out
echo status=$sts
_filter_date < $tmp.pmie1

# APPEND this to the above file
cat >> $tmp.pmie <<EOF
// 2 filesys.buffer_cache
sample.drift;

sample.double.one;
EOF
cp $tmp.pmie $tmp.pmie2

echo
echo "=== check that changes for unsupported versions are moved to end"
pmieconf -r ./pconf -f $tmp.pmie2 m network.interface_bytes holdoff 40 >/dev/null
echo status=$?
pmie -C $tmp.pmie2 >$tmp.out 2>&1
sts=$?
_filter_pmie <$tmp.out
echo status=$sts
_filter_date < $tmp.pmie2

cp $tmp.pmie $tmp.pmie3
$sudo mv ./pconf/cpu/load_average $tmp.load
echo
echo "=== check that changes for unsupported rules are moved to end"
pmieconf -r ./pconf -f $tmp.pmie3 m filesys.buffer_cache holdoff 120 >/dev/null
$sudo mv $tmp.load ./pconf/cpu/load_average
echo status=$?
pmie -C $tmp.pmie3 >$tmp.out 2>&1
sts=$?
_filter_pmie <$tmp.out
echo status=$sts
_filter_date < $tmp.pmie3

# success, all done
status=0
exit