From f0b46b0422f6ce3bb7c360ee3717eef95d621526 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 26 Jul 2018 05:00:51 +0100 Subject: [PATCH] test suite: Honour DGIT_SCHROOT_CHROOT to set the schroot to use for the sbuild tests. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ tests/lib | 3 +++ tests/lib-restricts | 2 ++ tests/tests/build-modes-sbuild | 2 +- tests/tests/quilt-gbp-build-modes-sbuild | 2 +- tests/tests/sbuild-gitish | 2 +- 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index f0b69194..d4ce818d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ dgit (6.0~) unstable; urgency=medium * dgit: Always build the source package ourselves, rather than sometimes leaving that to the builder command. dgit will now usually generate *_multi.changes rather than *_$arch.changes. + * test suite: Honour DGIT_SCHROOT_CHROOT to set the schroot to + use for the sbuild tests. -- diff --git a/tests/lib b/tests/lib index 2771252b..a297227f 100644 --- a/tests/lib +++ b/tests/lib @@ -74,6 +74,9 @@ incoming = $tmp/incoming run_dinstall = 0 END +schroot=${DGIT_SCHROOT_CHROOT:-build} +# Pretty much any Debian sid snapshot schroot will do. + : ${t_archive_method:=aq} : ${tagpfx:=archive/test-dummy} : ${suitespecs:=sid:unstable} diff --git a/tests/lib-restricts b/tests/lib-restricts index bb695c45..dfaaa25e 100644 --- a/tests/lib-restricts +++ b/tests/lib-restricts @@ -13,6 +13,8 @@ t-restriction-x-dgit-git-only () { } t-restriction-x-dgit-schroot-build () { + # if DGIT_SCHROOT_CHROOT is set, user wants not to skip this test + if [ "x${DGIT_SCHROOT_CHROOT}" != x ]; then return 0; fi schroot -l -c build 2>&1 >/dev/null || return 1 } diff --git a/tests/tests/build-modes-sbuild b/tests/tests/build-modes-sbuild index 19dcc8a4..cda07836 100755 --- a/tests/tests/build-modes-sbuild +++ b/tests/tests/build-modes-sbuild @@ -9,7 +9,7 @@ t-restrict x-dgit-schroot-build bm_quirk_after_act=bm-quirk-sbuild-after-act bm-prep -act="sbuild -c build --no-arch-all" +act="sbuild -c $schroot --no-arch-all" real_act="$act" bm-guess-e-source-e-targets "$act" diff --git a/tests/tests/quilt-gbp-build-modes-sbuild b/tests/tests/quilt-gbp-build-modes-sbuild index 4c86bfe5..ec1d1c7f 100755 --- a/tests/tests/quilt-gbp-build-modes-sbuild +++ b/tests/tests/quilt-gbp-build-modes-sbuild @@ -7,6 +7,6 @@ t-dependencies sbuild t-restrict x-dgit-schroot-build bm-gbp-example-acts \ - 'sbuild -c build --arch-all' \ + "sbuild -c $schroot --arch-all" \ t-ok diff --git a/tests/tests/sbuild-gitish b/tests/tests/sbuild-gitish index 6e497b2d..da90b6f4 100755 --- a/tests/tests/sbuild-gitish +++ b/tests/tests/sbuild-gitish @@ -16,7 +16,7 @@ buildrune=$( next unless m/^ +\%/ .. 0; next if !m/\S/ .. 0; s/^ +\%//; - $fixchr += s/(\s-c\s*)jessie(\s|$)/$1build$2/; + $fixchr += s/(\s-c\s*)jessie(\s|$)/$1'"$schroot"'$2/; print or die $!; END { $fixchr == 1 or die $fixchr; } ' -- 2.30.2