This file is indexed.

/usr/bin/pkgos-dh_auto_test is in openstack-pkg-tools 75.

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

set -e
set -x

# Config vars
PKGOS_USE_PY2=yes
PKGOS_USE_PY3=yes
PKGOS_TEST_PARALLEL=yes

# Vars used in commands
PYTHONS=disabled
PYTHON3S=disabled
TEST_PARALLEL_OPT="--parallel"

for i in $@ ; do
	case "${1}" in
	"--no-py3")
		PKGOS_USE_PY3=no
		shift
		;;
	"--no-py2")
		PKGOS_USE_PY2=no
		shift
		;;
        "--no-parallel")
                PKGOS_TEST_PARALLEL=no
                shift
                ;;
	*)
		;;
	esac
done

if [ "${PKGOS_USE_PY2}" = "yes" ] ; then
	PYTHONS=2.7
fi
if [ "${PKGOS_USE_PY3}" = "yes" ] ; then
	PYTHON3S=$(py3versions -vr 2>/dev/null)
fi
if [ "${PKGOS_TEST_PARALLEL}" = "no" ] ; then
	TEST_PARALLEL_OPT=""
fi

for pyvers in ${PYTHONS} ${PYTHON3S}; do
	if [ "${pyvers}" = "disabled" ] ; then
		continue
	fi
	PYMAJOR=$(echo ${pyvers} | cut -d'.' -f1)
	echo "===> Testing with python${pyers} (python${PYMAJOR})"
	if [ "${PYMAJOR}" = "3" ] ; then
		if [ -d `pwd`/debian/tmp/usr/lib/python3/dist-packages ] && [ -z "${PYTHONPATH}" ] ; then
			export PYTHONPATH=`pwd`/debian/tmp/usr/lib/python3/dist-packages
		fi
	elif [ "${PYMAJOR}" = "2" ] ; then
		if [ -d `pwd`/debian/tmp/usr/lib/python3/dist-packages ] && [ -z "${PYTHONPATH}" ] ; then
			export PYTHONPATH=`pwd`/debian/tmp/usr/lib/python2.7/dist-packages
		fi
	fi
	if [ -e .stestr.conf ] ; then
		rm -rf .stestr
		PYTHON=python${pyvers} python${PYMAJOR}-stestr run --subunit ${1} | subunit2pyunit
		python${PYMAJOR}-stestr slowest
		rm -rf .stestr
	elif [ -e .testr.conf ] ; then
		rm -rf .testrepository
		testr-python${PYMAJOR} init
		TEMP_REZ=$(mktemp -t)
		PYTHON=python${pyvers} testr-python${PYMAJOR} run ${TEST_PARALLEL_OPT} --subunit ${1} | tee ${TEMP_REZ} | subunit2pyunit
		cat ${TEMP_REZ} | subunit-filter -s --no-passthrough | subunit-stats
		rm -f ${TEMP_REZ}
		testr-python${PYMAJOR} slowest
		rm -rf .testrepository
	fi
done