tests: Remove vestigial support for putting Python 2 in a runtime
authorSimon McVittie <smcv@debian.org>
Mon, 20 Aug 2018 15:30:42 +0000 (16:30 +0100)
committerSimon McVittie <smcv@debian.org>
Mon, 20 Aug 2018 20:29:02 +0000 (21:29 +0100)
This is only used in the flatpak-builder tests now, not the main
flatpak tests.

Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://github.com/flatpak/flatpak/pull/1990

Gbp-Pq: Name tests-Remove-vestigial-support-for-putting-Python-2-in-a-.patch

tests/libtest.sh
tests/make-test-runtime.sh

index 0d22fa12b94c161569c34a5b468a1dc9e32c0a6c..4154b7bdc81c966cb59d79be958da0cf3ba25573 100644 (file)
@@ -271,19 +271,6 @@ setup_sdk_repo () {
     update_repo $REPONAME "${COLLECTION_ID}"
 }
 
-setup_python2_repo () {
-    REPONAME=${1:-test}
-    if [ x${USE_COLLECTIONS_IN_SERVER-} == xyes ] ; then
-        COLLECTION_ID=${2:-org.test.Collection.${REPONAME}}
-    else
-        COLLECTION_ID=""
-    fi
-
-    GPGARGS="${GPGARGS:-${FL_GPGARGS}}" . $(dirname $0)/make-test-runtime.sh ${REPONAME} org.test.PythonPlatform "${COLLECTION_ID}" bash python2 ls cat echo rm readlink > /dev/null
-    GPGARGS="${GPGARGS:-${FL_GPGARGS}}" . $(dirname $0)/make-test-runtime.sh ${REPONAME} org.test.PythonSdk "${COLLECTION_ID}" python2 bash ls cat echo rm readlink make mkdir cp touch > /dev/null
-    update_repo $REPONAME "${COLLECTION_ID}"
-}
-
 install_repo () {
     REPONAME=${1:-test}
     ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Platform master
@@ -295,12 +282,6 @@ install_sdk_repo () {
     ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Sdk master
 }
 
-install_python2_repo () {
-    REPONAME=${1:-test}
-    ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.PythonPlatform master
-    ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.PythonSdk master
-}
-
 run () {
     ${CMD_PREFIX} flatpak run "$@"
 
@@ -322,13 +303,6 @@ skip_without_bwrap () {
     fi
 }
 
-skip_without_python2 () {
-    if ! test -f /usr/bin/python2 || ! /usr/bin/python2 -c "import sys; sys.exit(0 if sys.version_info >= (2, 7) else 1)" ; then
-        echo "1..0 # SKIP this test requires /usr/bin/python2 (2.7) support"
-        exit 0
-    fi
-}
-
 sed s#@testdir@#${test_builddir}# ${test_srcdir}/session.conf.in > session.conf
 dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \
     3> dbus-session-bus-address 4> dbus-session-bus-pid
index 0fd95733104fd852ba37bed94ee18849ac7f014f..9ba371135a65e4170a7401191c4799dc7936aa87 100755 (executable)
@@ -61,31 +61,6 @@ add_bin() {
 for i in $@; do
     I=`which $i`
     add_bin $I
-    if test $i == python2; then
-        mkdir -p ${DIR}/usr/lib/python2.7/lib-dynload
-        # This is a hardcoded minimal set of modules we need in the current tests.
-        # Pretty hacky stuff. Add modules as needed.
-        PYDIR=/usr/lib/python2.7
-        if test -d /usr/lib64/python2.7; then PYDIR=/usr/lib64/python2.7; fi
-        for py in site os stat posixpath genericpath warnings \
-                       linecache types UserDict abc _abcoll \
-                       _weakrefset copy_reg traceback sysconfig \
-                       re sre_compile sre_parse sre_constants \
-                       _sysconfigdata ; do
-            cp ${PYDIR}/$py.py ${DIR}/usr/lib/python2.7
-        done
-        # These might not exist, depending how Python was configured; and the
-        # part after ${so} might be "module" or ".x86_64-linux-gnu" or
-        # something else
-        for so in _locale strop ; do
-            cp ${PYDIR}/lib-dynload/${so}*.so ${DIR}/usr/lib/python2.7/lib-dynload || :
-        done
-        for plat in $( cd ${PYDIR} && echo plat-* ); do
-            test -e ${PYDIR}/${plat} || continue
-            mkdir -p ${DIR}/usr/lib/python2.7/${plat}
-            cp ${PYDIR}/${plat}/*.py ${DIR}/usr/lib/python2.7/${plat}/
-        done
-    fi
 done
 for i in `cat $BINS`; do
     echo Adding binary $i 1>&2