This file is indexed.

/usr/share/pacemaker/tests/coverage.sh is in pacemaker-dev 1.1.10+git20130802-1ubuntu2.4.

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
#!/bin/bash

start=$PWD
test_home=`dirname $0`
sanitydir=/usr/share/pacemaker/tests

if [ $test_home != $sanitydir ]; then
    # Running against the source tree
    GCOV_BASE=/build/pacemaker-SjDV6Z/pacemaker-1.1.10+git20130802
    sanitydir=/build/pacemaker-SjDV6Z/pacemaker-1.1.10+git20130802
    cd /build/pacemaker-SjDV6Z/pacemaker-1.1.10+git20130802
    
    grep with-gcov config.log
    if [ $? = 0 ]; then
	echo "Pacemaker was built with gcov support"
    else
	echo "Re-building with gcov support"
	last=`grep --color=never "$.*configure" config.log | tail -n 1 | sed s:.*configure:./configure: | sed s:--no-create:--with-gcov:`
	eval $last
    fi
    
    #sudo make core core-install

else
    GCOV_BASE=/var/lib/pacemaker/gcov/
    mkdir -p $GCOV_BASE

    export GCOV_PREFIX_STRIP=4
    export GCOV_PREFIX=$GCOV_BASE

    top=`find / -name crm_internal.h 2>/dev/null | grep debug | head -n 1`
    if [ "x$top" = x ]; then
	echo "Could not locate the pacemaker headers"
	exit 1
    fi

    cd `dirname $top`
    cd ..

    echo "Creating the directory structure in $GCOV_BASE from $PWD"
    # The .gcno files will already be there for sources,
    # but we still need to create the include/ subtree
    find . -type d -exec mkdir -p $GCOV_BASE/\{\} \;

    echo "Now linking the source files into place"
    find . -type f -name "*.c" -exec ln -s $PWD/\{\} $GCOV_BASE\{\} \;
    find . -type f -name "*.h" -exec ln -s $PWD/\{\} $GCOV_BASE\{\} \;
    find . -type f -name "*.debug" -exec ln -s $PWD/\{\} $GCOV_BASE\{\} \;
fi

cd $start
lcov -d $GCOV_BASE -z

# Run all active regression tests
$sanitydir/BasicSanity.sh

lcov -d $GCOV_BASE -c -o pacemaker.info

rm -rf html
mkdir html
genhtml -o html pacemaker.info