This file is indexed.

/var/lib/pcp/testsuite/623 is in pcp-testsuite 4.0.1-1.

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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/sh
# PCP QA Test No. 623
# pmlogger_daily - options from environment
#
# Copyright (c) 2018 Ken McDonell.  All Rights Reserved.
#

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

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

if which xz >/dev/null 2>&1
then
    PROG=xz
    SUFF=xz
elif which bzip2 >/dev/null 2>&1
then
    PROG=bzip2
    SUFF=bz2
elif which gzip >/dev/null 2>&1
then
    PROG=gzip
    SUFF=gz
else
    _notrun "cannot find a compression program!"
fi

_cleanup()
{
    cd $here
    $sudo rm -rf $tmp $tmp.*
}

DATE=`pmdate -3d '%Y%m%d'`

_setup_control()
{
    echo '$version=1.1' >$tmp.control 
    for arg
    do
	echo "\$$arg" >>$tmp.control
    done
    echo "LOCALHOSTNAME	n   n	$tmp	$tmp.config" >>$tmp.control
    cat $tmp.control >>$seq.full
}

_setup()
{
    rm -f $tmp/* $tmp.log
    cp archives/ok-mv-bigbin.* $tmp
    for arch in $tmp/ok-mv-bigbin.*
    do
	touch -t ${DATE}0102 $arch
	mv $arch `echo $arch | sed -e "s/ok-mv-bigbin/${DATE}.01.02/"`
    done
}

_filter()
{
    if [ $# -eq 0 ]
    then
	cmd=cat
    elif [ -f "$1" ]
    then
	cmd="cat \"$1\""
    else
	return
    fi
    eval $cmd \
    | tee -a $here/$seq.full \
    | sed \
	-e '/pmlogger_daily.pid: Permission denied/d' \
	-e '/no pmlogger instance running for host/d' \
	-e '/^pmlogger_daily:.*\.control:[0-9]]$/d' \
	-e '/logging for host .* unchanged/d' \
    # end
}

_showfiles()
{
    ls $tmp/* \
    | sed \
	-e "s@$tmp@TMP@" \
	-e "s/\.$SUFF$/.compressed/" \
	-e "s/$DATE/DATE/" \
    # end
}

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

mkdir $tmp

echo "log mandatory on default { pmcd }" >$tmp.config

# real QA test starts here

echo "simple cmd args" | tee -a $here/$seq.full
_setup_control
_filter $tmp.log
_setup
pmlogger_daily -f -X $PROG -x 1 -c $tmp.control -l $tmp.log
_filter $tmp.log
_showfiles

echo | tee -a $here/$seq.full
echo "simple env vars" | tee -a $here/$seq.full
_setup
PCP_COMPRESS=$PROG PCP_COMPRESSAFTER=1 pmlogger_daily -f -c $tmp.control -l $tmp.log
_filter $tmp.log
_showfiles

echo | tee -a $here/$seq.full
echo "some error cases" | tee -a $here/$seq.full
_setup
pmlogger_daily -f -x bozo -c $tmp.control -l $tmp.log
_filter $tmp.log
PCP_COMPRESSAFTER=bozo pmlogger_daily -f -c $tmp.control -l $tmp.log
_filter $tmp.log
pmlogger_daily -f -x 1 -X no-such-compression-tool -c $tmp.control -l $tmp.log
_filter $tmp.log
PCP_COMPRESS=no-such-compression-tool pmlogger_daily -f -x 1 -c $tmp.control -l $tmp.log
_filter $tmp.log

_setup_control PCP_COMPRESSAFTER=bozo
pmlogger_daily -f -c $tmp.control -l $tmp.log 2>&1 | _filter
_filter $tmp.log

echo | tee -a $here/$seq.full
echo "some warning cases" | tee -a $here/$seq.full
_setup_control
_setup
PCP_COMPRESS=$PROG PCP_COMPRESSAFTER=1 PCP_COMPRESSREGEX='\.index$' pmlogger_daily -f -X no-such-compression-tool -x 7 -Y xyz -c $tmp.control -l $tmp.log
_filter $tmp.log
_showfiles
_setup_control PCP_COMPRESS=$PROG PCP_COMPRESSAFTER=1 "PCP_COMPRESSREGEX='\.(index|meta)$'"
_setup
PCP_COMPRESS=foo PCP_COMPRESSAFTER=42 PCP_COMPRESSREGEX='\.bar$' pmlogger_daily -f -c $tmp.control -l $tmp.log
_filter $tmp.log
_showfiles

# success, all done
status=0
exit