This file is indexed.

/var/lib/pcp/testsuite/042 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
#!/bin/sh
# PCP QA Test No. 042
# Exercise fixes for some containers issues.
#
# Copyright (c) 2015 Red Hat.  All Rights Reserved.
#

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

. ./common.docker

_check_containers
_check_docker_images busybox

_cleanup()
{
    if [ -n "$container" ]
    then
        echo "== removing container" | tee -a $seq.full
        _remove_docker_containers $container
        container=""
    fi 
    rm -rf $tmp.*
}

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

_filter_pminfo()
{
    # filter ip_vti tunnel type connections that may exist on (some) machines
    tee -a $here/$seq.full >$tmp.tmp
    sed <$tmp.tmp \
	-e '/ip_vti/d' \
	-e '2q' \
    # end
    sed <$tmp.tmp \
	-e '1,2d' \
	-e 's/\[[0-9][0-9]* or ".*"\]/[INST or NAME]/' \
	-e 's/value [-?0-9.e+][-?0-9.e+]*/value NUMBER/' \
	-e 's/value ".*"$/value STRING/' \
    | LC_COLLATE=POSIX sort \
    | uniq
}

# real QA test starts here
container=`$docker run -d busybox sleep 15`
echo "== container: $container" >> $seq.full

echo "== kernel PMDA" | tee -a $seq.full
# expect 2 interfaces (lo/eth0) and 2 mounts
metrics="network.interface.in.bytes filesys.used"
for m in $metrics
do
    pminfo --fetch --container=$container $m | _filter_pminfo
done
echo

echo "== procfs PMDA" | tee -a $seq.full
# expect values for a single process (sleep) and one cgroup
metrics="proc.memory.rss cgroup.memory.stat.rss"
for m in $metrics
do
    pminfo --fetch --container=$container $m | _filter_pminfo
done
echo

echo "== pmcd PMDA" | tee -a $seq.full
# expect a different hostname to local hostname
pmprobe --values --container=$container pmcd.hostname > $tmp.chost
pmprobe --values pmcd.hostname > $tmp.host
container_hostname=`awk '{ print $3 }' $tmp.chost`
localhost_hostname=`awk '{ print $3 }' $tmp.host`

cat $tmp.chost $tmp.host >> $seq.full
echo container hostname: $container_hostname >> $seq.full
echo localhost hostname: $localhost_hostname >> $seq.full

if [ $container_hostname != $localhost_hostname ]
then
    echo
    echo "OK: host and container names are different"
    echo
else
    echo "FAIL: hostnames match when they should not"
    echo "localhost: $localhost_hostname"
    echo "container: $container_hostname"
    status=1
    exit
fi

# success, all done
status=0
exit