chiark / gitweb /
Test suite: Introduce $t_archive_method
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Nov 2016 20:40:04 +0000 (20:40 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Nov 2016 21:32:41 +0000 (21:32 +0000)
* Indirect t-archive-none and t-archive-query via this variable

* Rename t-archive-updated; it is for callers that have updated
  aq/package.$suite.$p.  There is one out-of-lib caller.

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

index 23daeac..2c5d56b 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -65,6 +65,7 @@ incoming              = $tmp/incoming
 run_dinstall           = 0
 END
 
+: ${t_archive_method:=aq}
 : ${tagpfx:=archive/test-dummy}
 : ${suitespecs:=sid:unstable}
 
@@ -226,6 +227,9 @@ t-prep-newpackage () {
 
 t-archive-none () {
        t-select-package $1
+       t-archive-none-$t_archive_method
+}
+t-archive-none-aq () {
        mkdir -p $tmp/aq/dsc_in_suite $tmp/mirror/pool/main
 
        : >$tmp/aq/suites
@@ -237,10 +241,10 @@ t-archive-none () {
                local sname=${suitespec#*:}
 
                >$tmp/aq/package.$suite.$p
-               t-archive-updated $suite $p
+               t-aq-archive-updated $suite $p
 
                >$tmp/aq/package.new.$p
-               t-archive-updated new $p
+               t-aq-archive-updated new $p
 
                ln -sf $suite $tmp/aq/dsc_in_suite/$sname
 
@@ -267,7 +271,7 @@ END
 END
 }
 
-t-archive-updated () {
+t-aq-archive-updated () {
        local suite=$1
        local p=$2
        local suitedir=$tmp/aq/dsc_in_suite/$suite
@@ -299,9 +303,16 @@ t-archive-process-incoming () {
 t-archive-query () {
        local suite=${1-sid}
        local dscf=main/${p}_${v}.dsc
+       t-archive-query-$t_archive_method "$suite" "$p" "$v" "$dscf"
+}
+t-archive-query-aq () {
+       local suite=$1
+       local p=$2
+       local v=$3
+       local dscf=$4
        local sha=`sha256sum <$tmp/mirror/pool/$dscf`
        echo "${v} ${sha%  -} $dscf" >>$tmp/aq/package.$suite.${p}
-       t-archive-updated $suite $p
+       t-aq-archive-updated $suite $p
 }
 
 t-archive () {
index 632d420..b34ba33 100755 (executable)
@@ -14,7 +14,7 @@ t-inarchive-copy () {
        local from=${2:-sid}
        local to=${3:-stable}
        egrep "^${vm//./\\.}" aq/package.$from.$p >>aq/package.$to.$p
-       t-archive-updated $to $p
+       t-aq-archive-updated $to $p
 }
 
 copy-check-good () {