#!/bin/sh set -e if [ "$(whoami)" = root ]; then if [ -n "$SUDO_USER" ] && getent passwd "$SUDO_USER" > /dev/null; then su_user="$SUDO_USER" else su_user=nobody fi if [ -e /etc/default/apport ]; then # stop apport service apport stop 2>/dev/null || true sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null fi fi tmphome=$ADTTMP/home mkdir -p $tmphome if [ -n "$su_user" ]; then chmod go+rx $ADTTMP chown $su_user:nogroup $tmphome fi ls -la $ADTTMP # no root access needed after this point debian_dir=$(dirname $(dirname $0)) export OPENSSL_CONF=$debian_dir/openssl.cnf export LOCPATH=$(pwd)/locales sh $debian_dir/locale-gen export LANG=C arch=$(dpkg --print-architecture) vendor=$(dpkg-vendor --query Vendor) tmphome=$ADTTMP/home mkdir -p $tmphome if [ -n "$su_user" ]; then chown $su_user $tmphome fi TESTPYTHON="python2.7-dbg -E -Wd -3 -tt /usr/lib/python2.7/test/regrtest.py" TESTOPTS="-w -uall,-network,-urlfetch,-gui,-xpickle" TESTEXCLUSIONS= # test_cpickle: starts to fail with 2.7.11, see http://bugs.python.org/issue25698 TESTEXCLUSIONS="$TESTEXCLUSIONS test_cpickle" # test_curses: error: copywin() returned ERR TESTEXCLUSIONS="$TESTEXCLUSIONS test_curses" # test_distutils: failing tests test_parse_makefile_base, test_parse_makefile_literal_dollar TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" # test_threading_local: fails in the Debian CI environment, but even # succeeds there when re-run. See # http://ci.debian.net/data/packages/unstable/amd64/p/python2.7/20141121_061940.autopkgtest.log.gz case "$vendor" in Debian) TESTEXCLUSIONS="$TESTEXCLUSIONS test_threading_local" esac # test_zipfile: Issue 17753, requires write access to test and email.test TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" # test_site: site-/dist-packages mismatches TESTEXCLUSIONS="$TESTEXCLUSIONS test_site" # TODO: test_ctypes fails on arm64 on the debug build echo "uname: $(uname -a)" case "$(uname -m)" in armv8*|aarch64*) TESTEXCLUSIONS="$TESTEXCLUSIONS test_ctypes" esac # FIXME: Fails with Ubuntu's autopkg test infrastructure if [ "$vendor" = Ubuntu ]; then if [ "$(dpkg --print-architecture)" = arm64 ]; then TESTEXCLUSIONS="$TESTEXCLUSIONS test_io" fi fi if [ "$su_user" = nobody ]; then log=/dev/null else log=testsuite-dbg.log fi script=$debian_dir/script.py echo "Running the failing tests with the standard interpreter:" progressions= for tst in $TESTEXCLUSIONS; do if [ -f "$script" ]; then cmd="HOME=$tmphome python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $tst\"" else cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $tst" fi echo "Running $tst ..." if [ "$(whoami)" = root ]; then echo "su -s /bin/sh -c $cmd $su_user" if su -s /bin/sh -c "$cmd" $su_user; then progressions="$progressions $tst" else : fi else echo "$cmd" if eval $cmd; then progressions="$progressions $tst" else : fi fi done if [ -n "$progressions" ]; then echo "Tests run: $TESTEXCLUSIONS" echo "Progressions:$progressions" fi exit 0