This file is indexed.

/var/lib/pcp/testsuite/1072 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
#!/bin/sh
# PCP QA Test No. 1072
# Exercise pmrep archive creation.
#
# Copyright (c) 2016 Red Hat.
#

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

. ./common.python

$python -c "from pcp import pmapi" >/dev/null 2>&1
[ $? -eq 0 ] || _notrun "python pcp pmapi module not installed"
$python -c "from collections import OrderedDict" >/dev/null 2>&1
[ $? -eq 0 ] || _notrun "python collections OrderedDict module not installed"

which pmrep >/dev/null 2>&1 || _notrun "pmrep not installed"

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

_live_filter()
{
    sed \
        -e "s/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/HH:MM:SS/g" \
    #end
}

_path_filter()
{
    sed \
        -e "s#$here#QAPATH#g" \
    #end
}

#  timezone: :Australia/Melbourne (reporting, current is AEDT-11)
#  this is not deterministic .... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_archive_filter()
{
    sed \
	-e '/timezone/s/ (reporting.*)//' \
    #end
}

_pid_filter()
{
    sed \
        -e '/archive:/s/archive: .*/archive: temp-archive/' \
        -e '/Recording/s/-[0-9][0-9]*//' \
    #end
}

log="--archive $here/archives/rep"
log2="--archive $here/archives/20130706 -O 10m"

# real QA test starts here
echo "== pmrep archive reporting and creation"
echo "Writing output from the original archives to files"
metrics1=$(pminfo $log         | grep -v event\. | LC_COLLATE=POSIX sort | tr '\n' ' ')
metrics2=$(pminfo $log2 kernel | grep -v event\. | LC_COLLATE=POSIX sort | tr '\n' ' ')
pmrep -u -s 5 -p -P 4 -w 12 -x -z $log  $metrics1 | _path_filter | _archive_filter >$tmp.a1-out
pmrep -u -s 5 -p -P 4 -w 12 -x -z $log2 $metrics2 | _path_filter | _archive_filter >$tmp.a2-out
pmrep -u -s 5 -o archive -F $tmp.new_archive1 -z $log  $metrics1 | _pid_filter
pmrep -u -s 5 -o archive -F $tmp.new_archive2 -z $log2 $metrics2 | _pid_filter
echo "Writing output from the created archives to files"
pmrep -u -s 5 -p -P 4 -w 12 -x -z -a $tmp.new_archive1 $metrics1 | \
  _path_filter | _archive_filter | _pid_filter >$tmp.a1-out-new
pmrep -u -s 5 -p -P 4 -w 12 -x -z -a $tmp.new_archive2 $metrics2 | \
  _path_filter | _archive_filter | _pid_filter >$tmp.a2-out-new
echo "Diff of outputs start (only path / minor timestamp diff expected):"
diff -u $tmp.a1-out $tmp.a1-out-new | grep -v +++ | grep -v -- ---
diff -u $tmp.a2-out $tmp.a2-out-new | grep -v +++ | grep -v -- ---
echo "Diff of outputs end"

echo "=== pmrep archive creation with filtering"
pmrep -u -s 5 -o archive -F $tmp.new_archive3 -z $log2 -i 'sda' -i '.*sdc.*' \
   disk.dev.write_bytes | _pid_filter
pmrep -u -s 5 -p -P 4 -w 12 -x -z -a $tmp.new_archive3 disk.dev.write_bytes | \
  _path_filter | _archive_filter | _pid_filter

echo "=== pmrep archive creation with discrete values"
pmrep -u -s 5 -o archive -F $tmp.new_archive4 -z $log hinv.machine mem.util.used | _pid_filter
pmrep -u -a $tmp.new_archive4 -z hinv.machine mem.util.used
pmdumplog -z -dim $tmp.new_archive4

rm -f $tmp.a1-out* $tmp.a2-out* $tmp.new_archive*

# success, all done
echo "== done"
status=0
exit