This file is indexed.

/usr/lib/python3/dist-packages/castellan/tests/contrib/post_test_hook.sh is in python3-castellan 0.17.0-0ubuntu1.

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

set -xe

CASTELLAN_DIR="$BASE/new/castellan"


function generate_testr_results {
    if [ -f .testrepository/0 ]; then
        sudo .tox/functional/bin/testr last --subunit > $WORKSPACE/testrepository.subunit
        sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
        sudo /usr/os-testr-env/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
        sudo gzip -9 $BASE/logs/testrepository.subunit
        sudo gzip -9 $BASE/logs/testr_results.html
        sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
        sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
    fi
}

owner=tempest

# Set owner permissions according to job's requirements.
cd $CASTELLAN_DIR
sudo chown -R $owner:stack $CASTELLAN_DIR

testenv=functional

# Run tests
echo "Running Castellan $testenv test suite"
set +e

sudo -H -u $owner tox -e $testenv

testr_exit_code=$?
set -e

# Collect and parse results
generate_testr_results
exit $testr_exit_code