chiark / gitweb /
dgit-repos-server: some better error msgs, more tests
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Mar 2014 00:46:48 +0000 (00:46 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Mar 2014 00:46:48 +0000 (00:46 +0000)
dgit-repos-server
tests/tests/drs-push-rejects

index add54245a665dda3601c8d79bcf932e30cecc7cf..49fa795d0c87a38f488653da5d2d5741c2c202f1 100755 (executable)
@@ -464,9 +464,9 @@ sub tagh1 ($) {
 sub checks () {
     debug "checks";
     checksuite();
 sub checks () {
     debug "checks";
     checksuite();
-    tagh1('type') eq 'commit' or die;
-    tagh1('object') eq $commit or die;
-    tagh1('tag') eq $tagname or die;
+    tagh1('type') eq 'commit' or reject "tag refers to wrong kind of object";
+    tagh1('object') eq $commit or reject "tag refers to wrong commit";
+    tagh1('tag') eq $tagname or reject "tag name in tag is wrong";
 
     my $v = $version;
     $v =~ y/~:/_%/;
 
     my $v = $version;
     $v =~ y/~:/_%/;
index fa3b53044b7d4d9ab10bbedd58787f808e310298..aa092bc81ee7eb73f05cc22a87af78f762d066a6 100755 (executable)
@@ -97,7 +97,17 @@ cp $tmp/dm.gpg $tmp/dd.gpg
 mustfail 'key not found in keyrings' $push_spec
 
 prep unstable sid
 mustfail 'key not found in keyrings' $push_spec
 
 prep unstable sid
+mktag HEAD~
+mustfail 'tag refers to wrong commit' $push_spec
+
+prep unstable sid
+mktag HEAD~:
+mustfail 'tag refers to wrong kind of object' $push_spec
+
+prep unstable sid
+mktag
 mustsucceed $push_spec # succeeds
 mustsucceed $push_spec # succeeds
+
 mktag
 mustfail 'not replacing previously-pushed version' $push_spec
 
 mktag
 mustfail 'not replacing previously-pushed version' $push_spec
 
@@ -113,6 +123,10 @@ prep_dm_mangle () {
 git checkout v2
 version=3-2_dummy2
 
 git checkout v2
 version=3-2_dummy2
 
+prep_dm_mangle ''
+perl -i.bak -ne 'print if 1..s/(pari-extra).*\n/$1/' $tmp/dm.txt
+mustfail '' $push_spec # malformed (truncated) dm.txt; don't care about msg
+
 prep_dm_mangle 's/allow:/asponge:/i'
 mustfail 'missing Allow section in permission' $push_spec
 
 prep_dm_mangle 's/allow:/asponge:/i'
 mustfail 'missing Allow section in permission' $push_spec