File: testsuite-dbg

package info (click to toggle)
python3.13 3.13.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,328 kB
  • sloc: python: 704,014; ansic: 653,914; xml: 31,250; sh: 5,844; cpp: 4,326; makefile: 1,981; objc: 787; lisp: 502; javascript: 213; asm: 75; csh: 12
file content (62 lines) | stat: -rwxr-xr-x 1,504 bytes parent folder | download | duplicates (3)
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/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=$AUTOPKGTEST_TMP/home
mkdir -p $tmphome/.local/lib/python3.9/site-packages
if [ -n "$su_user" ]; then
  chmod -R go+rx $AUTOPKGTEST_TMP
  chown -R $su_user:nogroup $tmphome
fi
ls -la $AUTOPKGTEST_TMP

debian_dir=$(dirname $(dirname $0))

# no root access needed after this point

TESTPYTHON="python3.13d -W default -bb -E -R -m test"
TESTEXCLUSIONS="-x"
TESTNEVERCOMPLETE=""

. $debian_dir/tests/test-common.sh
TESTEXCLUSIONS="$TESTEXCLUSIONS $TESTNEVERCOMPLETE"

if [ "$su_user" = nobody ]; then
  log=/dev/null
else
  log=testsuite-dbg.log
fi

# several tests fail with configured proxy; we don't need internet access, so
# unset proxy variables
EXTRAENV="env -u https_proxy -u http_proxy -u no_proxy HOME=$tmphome"

script=$debian_dir/script.py
if [ -f "$script" ]; then
  cmd="$EXTRAENV python3.13 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\""
else
  cmd="$EXTRAENV $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS"
fi

echo "Running the python testsuite with the debug enabled interpreter:"
if [ "$(whoami)" = root ]; then
  echo "su -s /bin/sh -c $cmd $su_user"
  su -s /bin/sh -c "$cmd" $su_user
else
  echo "$cmd"
  eval $cmd
fi