chiark / gitweb /
dgit: clone-dgit-repos-server: Set $access_forpush
[dgit.git] / tests / tests / protocol-compat
index 47074d51b2654a369f0b398baec6421ef24f906e..fc3960a8f9db5b467770b7908eb79e3af77f8809 100755 (executable)
@@ -11,30 +11,71 @@ prep () {
 }
 
 check () {
+       pd=$p.$suite
+       t-refs-same-start
+
        t-archive-none $p
        t-archive-query $suite
 
-       t-dgit clone $p stable $p.cloned
-       cd $p.cloned
+       t-dgit clone $p $suite $pd
+       cd $pd
        t-ref-head
 
+       $1
+
        t-dgit import-dsc $dscf +imported
        t-ref-same refs/heads/imported
        cd ..
 }
 
+reset () {
+       cd ..
+       rm -rf $pd
+       mkdir $pd
+       cd $pd
+       git init
+}
+
+: ---------- newer ----------
+
+suite=sid
+v=2.1
+prep
+
+perl -i~ -pe 's/^Dgit: .*/$& EXTRA DATA\n TO BE IGNORED/' $dscf
+
+check reset
+
+: ---------- newline ----------
+
+suite=testing
+v=2.0
+prep
+
+perl -i~ -pe 's/^(Dgit: \w+ \S+ \S+) (.*)/$1\n $2 EXTRA/' $dscf
+
+check reset
+
 : ---------- older ----------
 
 suite=stable
 v=1.2
-
 prep
 
 perl -i -pe 's/^(Dgit: \w+).*/$1/' $dscf
 
-dgit_config_debian_alias='-cdgit-distro.debian.alias-canon=test-dummy'
-# old Dgit fields are supposed to mean Debian
+t-git-config dgit.default.old-dsc-distro test-dummy
 
 check
 
-#t-ok
+: ---------- expect fail ----------
+
+pd=$p.fail
+
+t-git-config dgit.default.old-dsc-distro downstream
+
+t-expect-fail 'no configured url and .dsc provides no hint' \
+t-dgit clone $p $suite $pd
+
+
+t-ok