chiark / gitweb /
Test suite: setup import: Cope with nested and multiple imports
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 22 Oct 2016 18:02:03 +0000 (19:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 22 Oct 2016 18:05:40 +0000 (19:05 +0100)
Name the IMPORT file after the setup name.

This is important when running under autopkgtest, where all the setups
share the tmp directory with each other and with the main test.  The
setups need distinct IMPORTS.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/lib

index 07dbba6e668096e883b4d6797f25f991639baac2..571ab6799107977d656f2b60e6e2e110a74ef16c 100644 (file)
@@ -1,6 +1,7 @@
 dgit (2.5~) unstable; urgency=medium
 
   * dgit-maint-merge(7): New tutorial manpage from Sean Whitton.
 dgit (2.5~) unstable; urgency=medium
 
   * dgit-maint-merge(7): New tutorial manpage from Sean Whitton.
+  * Test suite bugfixes.
 
  --
 
 
  --
 
index 3ddb98051e85890572809e56172575275433e13f..fe8d8fc01ab5aa51a7c361113777a13a68bd4afa 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -381,7 +381,8 @@ t-setup-done () {
        local savedirs=$2
        local importeval=$3
 
        local savedirs=$2
        local importeval=$3
 
-       exec 4>$tmp/IMPORT.new
+       local import=IMPORT.${0##*/}
+       exec 4>$tmp/$import.new
 
        local vn
        for vn in $savevars; do
 
        local vn
        for vn in $savevars; do
@@ -390,11 +391,11 @@ t-setup-done () {
                ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
        done
 
                ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
        done
 
-       (set -e; cd $tmp; tar cf IMPORT.tar $savedirs)
+       (set -e; cd $tmp; tar cf $import.tar $savedirs)
 
        printf >&4 "\n%s\n" "$importeval"
 
 
        printf >&4 "\n%s\n" "$importeval"
 
-       mv -f $tmp/IMPORT.new $tmp/IMPORT
+       mv -f $tmp/$import.new $tmp/$import
 }
 
 t-setup-import () {
 }
 
 t-setup-import () {
@@ -412,7 +413,7 @@ t-setup-import () {
                lock="$setupsrc.lock"
        fi
 
                lock="$setupsrc.lock"
        fi
 
-       local simport="$setupsrc/IMPORT"
+       local simport="$setupsrc/IMPORT.$setupname"
 
        if ! [ -e "$simport" ]; then
                with-lock-ex -w "$lock" \
 
        if ! [ -e "$simport" ]; then
                with-lock-ex -w "$lock" \