[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#806420: debian-edu: test suite times out on ci.debian.net



Control: tags -1 patch

On 14-03-18 10:53, Holger Levsen wrote:
>> If you want/need help to fix this bug, let me know and I'll try to have
>> a look.
>  
> we surely would appreciate help fixing this bug!

I believe the attached patch would be able to fix this bug and on top of
that make the test script a lot simpler and easier to understand. Please
verify that the script still does what is intended.

Please note the chmod on d/t/test-metapkgs that is required.

Also, I wonder if really all the current combinations of DESKTOP and
PROFILE need to be tested, or some smarter combination could be chosen
such that test time can be reduced while still having confidence that
most code paths are tested. I haven't optimized for this yet.

Paul
From c6e6f10488af80d4a76ee24ecd1bd162ae8b53b4 Mon Sep 17 00:00:00 2001
From: Paul Gevers <elbrus@debian.org>
Date: Thu, 15 Mar 2018 13:26:10 +0100
Subject: [PATCH] Rearrange autopkgtests such that the don't time out anymore

- run PROFILE/DESKTOP combinations separately
- get rid of debootstrap (as it isn't needed anymore)
- greatly simplify test code
---
 debian/tests/control       | 12 ++++++++--
 debian/tests/test-metapkgs | 59 +++-------------------------------------------
 2 files changed, 13 insertions(+), 58 deletions(-)
 mode change 100644 => 100755 debian/tests/test-metapkgs

diff --git a/debian/tests/control b/debian/tests/control
index e76e2a1c..d1611a5a 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,11 @@
-Tests:  test-tasksel-desktop test-metapkgs
-Depends: debootstrap, debian-edu-install, education-common, education-tasks
+Tests: test-tasksel-desktop
+Depends: education-common
+Restrictions: needs-root allow-stderr
+
+Test-Command: PROFILE=Minimal debian/tests/test-metapkgs
+Depends: education-common, how-can-i-help
+Restrictions: needs-root allow-stderr
+
+Test-Command: PROFILE=Workstation DESKTOP=kde debian/tests/test-metapkgs
+Depends: education-common, how-can-i-help
 Restrictions: needs-root allow-stderr
diff --git a/debian/tests/test-metapkgs b/debian/tests/test-metapkgs
old mode 100644
new mode 100755
index 6a374603..6e4d4653
--- a/debian/tests/test-metapkgs
+++ b/debian/tests/test-metapkgs
@@ -1,60 +1,17 @@
 #!/bin/sh
 set -e
 
-at_exit() {
-    echo "info: terminating script"
-    for m in $umount ; do
-	echo info: umounting "$m"
-	umount "$m"
-    done
-}
-
-trap at_exit INT TERM EXIT
-
-# Make sure temp directory setting do not leak into chroot.
-chroot_run() {
-    target=$1
-    shift
-    TMP= TMPDIR= TEMP= TEMPDIR= chroot $target "$@"
-}
-
 chroot_test() {
     echo
     echo "Installing Debian Edu chroot with profile $PROFILE and desktop $DESKTOP"
     echo
     cd $ADTTMP
-    target=test-chroot
-    suite=testing
-    edusuite=buster
-    debootstrap $suite $target
-    printf "#!/bin/sh\nexit 101\n" > $target/usr/sbin/policy-rc.d
-    chmod a+rx $target/usr/sbin/policy-rc.d
-    mount -t proc proc $target/proc
-    umount="$target/proc"
-    mount -t sysfs sysfs $target/sys
-    umount="$target/proc $target/sys"
 
-    # The bless script is recently part of the debian-edu-config package.
-    if [ -x /usr/share/debian-edu-config/tools/debian-edu-bless ] ; then
-	cp /usr/share/debian-edu-config/tools/debian-edu-bless \
-	    $target/root/.
-    else
-	apt-get source debian-edu-config 2>&1
-	cp debian-edu-config-*/share/debian-edu-config/tools/debian-edu-bless \
-	    $target/root/.
-    fi
     PROFILE=$PROFILE DESKTOP=$DESKTOP EDUSUITE=$edusuite \
-	chroot_run $target sh -x /root/debian-edu-bless 2>&1
+        sh -x /usr/share/debian-edu-config/tools/debian-edu-bless 2>&1
 
     # List packages with problems in Debian
-    chroot_run $target apt-get install -y how-can-i-help
-    chroot_run $target how-can-i-help --old
-
-    umount $target/proc
-    umount="$target/sys"
-    umount $target/sys
-    umount=""
-    rm -rf $target
+    how-can-i-help --old
 }
 
 # Use predictable language setting.
@@ -73,14 +30,4 @@ echo "info: File system status (/proc/mounts):"
 cat /proc/mounts
 echo
 
-# Install profiles in chroots, first the non-desktop ones
-for profile in Minimal Main-Server; do
-    PROFILE="$profile" chroot_test
-done
-
-# Then the desktop ones
-for profile in Workstation Roaming-Workstation LTSP-Server Standalone; do
-    for desktop in kde gnome lxde xfce mate ; do
-        DESKTOP="$desktop" PROFILE="$profile" chroot_test
-    done
-done
+chroot_test
-- 
2.16.2

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: