This file is indexed.

/var/lib/pcp/testsuite/657 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
#! /bin/sh
# PCP QA Test No. 657
# checks pmdadm functionality
# Requires dmsetup utility to be installed, else the test will
# not run (PMDA will fail to install).
#
# Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
#
seq=`basename $0`

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

echo "QA output created by $seq"

[ $PCP_PLATFORM = linux ] || _notrun "Device Mapper is Linux-specific (dm)"
[ -d $PCP_PMDAS_DIR/dm ] || _notrun "dm PMDA directory is not installed"
which dmsetup >/dev/null 2>&1 || _notrun "dmsetup is not installed"

root=$tmp.root
export DM_SETUP_CACHE="cat $root/dmcache-caches"
export DM_SETUP_THINPOOL="cat $root/dmthin-pool"
export DM_SETUP_THIN="cat $root/dmthin-thin"

# don't want Install to possibly restart pmcd via systemctl, as this
# will clobber the environment, ...
#
_service pcp stop | _filter_pcp_stop
if [ "$PCPQA_SYSTEMD" = x -o "${PCPQA_SYSTEMD-x}" != x ]
then
    # $PCPQA_SYSTEMD is already set ...
    save_pcpqa_systemd="$PCPQA_SYSTEMD"
    restore_pcpqa_systemd=true
else
    restore_pcpqa_systemd=false
fi
export PCPQA_SYSTEMD=no

# helper functions

_install_pmda()
{
    # install the PMDA
    # Note: warnings from dmstats install are optional, so filter 'em out
    # Note: VDO stats are exercised via separate tests, so filter 'em out
    #
    cd $PCP_PMDAS_DIR/dm
    $sudo ./Remove < /dev/null >/dev/null 2>&1
    $sudo ./Install < /dev/null >$tmp.out 2>&1
    cat $tmp.out \
    | _filter_pmda_install \
    | sed \
	-e '/.*pmcd.*/d' \
	-e '/.*pmlogger.*/d' \
	-e '/^NOTE:.*/d' \
	-e '/Latest.*/d' \
	-e '/Duplicate.*/d' \
	-e '/^See also.*/d' \
	-e '/^Check vdo metrics.*/d' \
	-e '/^To use the dmstats metrics.*/d' \
	-e '/^Check dmstats metrics/s/[0-9][0-9]* warnings, //' \
    | tr -s '\n'
}

_remove_pmda()
{
    cd $PCP_PMDAS_DIR/dm
    $sudo ./Remove < /dev/null > /dev/null 2>&1
}

_cleanup()
{
    if $restore_pcpqa_systemd
    then
	export PCPQA_SYSTEMD="$save_pcpqa_systemd"
    else
	unset PCPQA_SYSTEMD
    fi
    _restore_pmda_install dm
    _service pcp restart | _filter_pcp_start
    _restore_auto_restart pmcd
    _wait_for_pmcd
    _wait_for_pmlogger
    $sudo rm -fr $root
    $sudo rm -fr $tmp.*.dir
    $sudo rm -f $tmp.*
    exit $status
}

status=1 # failure is the default!
trap "_cleanup" 0 1 2 3 15
_stop_auto_restart pmcd

$sudo rm -fr $root
$sudo rm -fr $tmp.*.dir
$sudo rm -f $tmp.* $seq.full
touch $here/$seq.full

# real QA test starts here
cd $here

echo
echo "=== Setting up QA fakeroot testing data ==="
$sudo rm -fr $root
mkdir $root || _fail "root in use when processing fakeroot"
cd $root
echo 'zz_cache: 0 1677721600 cache 8 10162/262144 128 39839/3276800 1087840 821795 116320 2057235 0 39835 0 1 writeback 2 migration_threshold 2048 mq 10 random_threshold 4 sequential_threshold 0 discard_promote_adjustment 1 read_promote_adjustment 0 write_promote_adjustment 0' > $root/dmcache-caches
echo 'yy_pool: 0 409600 thin-pool 0 13/65536 0/3200 - rw no_discard_passdown queue_if_no_space' > $root/dmthin-pool
echo 'vg_1-lv3: 0 8388608 thin 7000704 8388607
vg_1-lv2: 0 8388608 thin 6832768 8388607' > $root/dmthin-thin
cd $here

echo
echo "=== Installing Device Mapper PMDA ==="
_prepare_pmda_install dm
_install_pmda

echo
echo "=== Check dm-cache metrics ==="
pminfo -dfmtT dmcache

echo
echo "=== Check dm-thin metrics for thin pool metrics ==="
pminfo -dfmtT dmthin.pool

echo
echo "=== Check dm-thin metrics for thin vol metrics ==="
pminfo -dfmtT dmthin.vol

# cleanup
_remove_pmda

status=0
exit