chiark / gitweb /
tests: drs-push-rejects: introduce and use "mustsucceed"
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Mar 2014 18:27:56 +0000 (18:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Mar 2014 18:29:09 +0000 (18:29 +0000)
tests/tests/drs-push-rejects

index f6b5880..67e0dfb 100755 (executable)
@@ -37,6 +37,15 @@ mustfail () {
        diff $tmp/show-refs.{pre,post}-push
 }
 
+mustsucceed () {
+       reporefs >$tmp/show-refs.pre-push
+       git push origin "$@"
+       reporefs >$tmp/show-refs.post-push
+       if diff $tmp/show-refs.{pre,post}-push >$tmp/show-refs.diff; then
+               fail "no refs updated"
+       fi
+}
+
 prep () {
        local suite=$1
        local csuite=$2
@@ -88,7 +97,7 @@ cp $tmp/dm.gpg $tmp/dd.gpg
 mustfail 'key not found in keyrings' $push_spec
 
 prep unstable sid
-git push origin $push_spec # succeeds
+mustsucceed $push_spec # succeeds
 mktag
 mustfail 'not replacing previously-pushed version' $push_spec
 
@@ -114,6 +123,6 @@ prep_dm_mangle 'y/0-9/5-90-4/ if m/^fingerprint:/i'
 mustfail "not in permissions list although in keyring" $push_spec
 
 prep_dm_mangle ''
-git push origin $push_spec # succeeds
+mustsucceed $push_spec # succeeds
 
 echo ok.