[Git][qa/jenkins.debian.net][master] installation tests: rework to use mmdebstrap hook
Holger Levsen (@holger)
gitlab at salsa.debian.org
Thu Aug 21 18:00:15 BST 2025
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
701343a1 by Jochen Sprickerhof at 2025-08-21T19:00:07+02:00
installation tests: rework to use mmdebstrap hook
Removed because mmdebstrap does it:
- policy-rc.d
- cleanup
- mount proc
The network error retry logic is dropped as it is not easy to implement.
(cherry picked from commit 6219604a8cc59315e67f884ee3f772c349c44b9d)
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/chroot-installation.sh
Changes:
=====================================
bin/chroot-installation.sh
=====================================
@@ -17,7 +17,7 @@ set -e
if [ "$1" = "" ] ; then
echo "need at least one distribution to act on"
echo '# $1 = base distro'
- echo '# $2 = component to test (gnome, kde, xfce, lxce)'
+ echo '# $2 = component to test (gnome, kde, xfce, lxqt)'
echo '# $3 = upgrade distro'
exit 1
fi
@@ -29,25 +29,12 @@ SLEEP=$(shuf -i 1-10 -n 1)
echo "Sleeping $SLEEP seconds to randomize start times and parallel runs."
sleep $SLEEP
-export CHROOT_TARGET=$(mktemp -d -p /chroots/ chroot-installation-$1.XXXXXXXXX)
-sudo chmod +x $CHROOT_TARGET # workaround #844220 / #872812
-export TMPFILE=$(mktemp -u)
-export CTMPFILE=$CHROOT_TARGET/$TMPFILE
-export TMPLOG=$(mktemp)
+export CTMPFILE=$(mktemp)
cleanup_all() {
echo "Doing cleanup now."
set -x
- # test if $CHROOT_TARGET starts with /chroots/
- if [ "${CHROOT_TARGET:0:9}" != "/chroots/" ] ; then
- echo "HALP. CHROOT_TARGET = $CHROOT_TARGET"
- exit 1
- fi
- if mountpoint -q "$CHROOT_TARGET/proc" ; then
- sudo umount -l "$CHROOT_TARGET/proc"
- fi
- sudo rm -rf --one-file-system $CHROOT_TARGET || fuser -mv $CHROOT_TARGET
- rm -f $TMPLOG
+ rm -f "$CTMPFILE"
echo "\$1 = $1"
if [ "$1" != "fine" ] ; then
exit 1
@@ -58,37 +45,12 @@ cleanup_all() {
execute_ctmpfile() {
echo "echo xxxxxSUCCESSxxxxx" >> $CTMPFILE
- set -x
- chmod +x $CTMPFILE
- set -o pipefail # see eg http://petereisentraut.blogspot.com/2010/11/pipefail.html
- (sudo chroot $CHROOT_TARGET $TMPFILE 2>&1 | tee $TMPLOG) || true
- RESULT=$(grep "xxxxxSUCCESSxxxxx" $TMPLOG || true)
- if [ -z "$RESULT" ] ; then
- RESULT=$(grep -E "Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway|Service Unavailable|Hash Sum mismatch)" "$TMPLOG" || true)
- if [ -n "$RESULT" ] ; then
- echo
- echo "$(date -u) - Warning: Network problem detected."
- echo "$(date -u) - trying to workaround temporarily failure fetching packages, sleeping 5min before trying again..."
- sleep 5m
- echo
- sudo chroot $CHROOT_TARGET $TMPFILE
- else
- echo "Failed to run $TMPFILE in $CHROOT_TARGET."
- exit 1
- fi
- fi
- rm $CTMPFILE
- set +o pipefail
- set +x
}
prepare_bootstrap() {
cat >> $CTMPFILE <<-EOF
$SCRIPT_HEADER
set -x
-mount /proc -t proc /proc
-echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
-chmod +x /usr/sbin/policy-rc.d
# the proxy runs on ionos14
echo 'Acquire::http::Proxy "http://ionos14-amd64.debian.net:3128";' > /etc/apt/apt.conf.d/80proxy
cat > /etc/apt/apt.conf.d/80debug << APTEOF
@@ -168,10 +130,6 @@ EOF
}
bootstrap() {
- echo "Bootstraping $1 into $CHROOT_TARGET now."
- set -x
- sudo mmdebstrap $1 $CHROOT_TARGET $MIRROR
- set +x
prepare_bootstrap $1
execute_ctmpfile
}
@@ -304,10 +262,13 @@ fi
if [ -n "$REPRO" ] ; then
echo
echo Trying to run debian-repro-status:
- sudo chroot $CHROOT_TARGET debian-repro-status > /dev/null || true
+ echo "debian-repro-status > /dev/null || true" >> $CTMPFILE
echo
fi
+chmod +x "$CTMPFILE"
+TMPDIR=/chroots/ mmdebstrap --variant=apt --customize-hook="copy-in $CTMPFILE /tmp" --chrooted-customize-hook="$CTMPFILE" "$DISTRO" /dev/null # "$MIRROR"
+
echo "Debug: Removing trap."
trap - INT TERM EXIT
echo "Debug: Cleanup fine"
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/701343a17529a44f9b2d69b17a35cb87042ec364
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/701343a17529a44f9b2d69b17a35cb87042ec364
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20250821/c124ebf8/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list