15 if test -d $tmp/git/$p.git; then
22 local wantmsg="$1"; shift
23 reporefs >$tmp/show-refs.pre-push
25 git push origin "$@" 2>&1 |tee $tmp/mustfail.txt
29 "0 0") fail "push unexpectedly succeeded: $*" ;;
31 *) fail "tee failed" ;;
33 if ! fgrep "$wantmsg" $tmp/mustfail.txt >/dev/null; then
34 fail "error message not found"
36 reporefs >$tmp/show-refs.post-push
37 diff $tmp/show-refs.{pre,post}-push
41 reporefs >$tmp/show-refs.pre-push
43 reporefs >$tmp/show-refs.post-push
44 if diff $tmp/show-refs.{pre,post}-push >$tmp/show-refs.diff; then
45 fail "no refs updated"
52 cp $tmp/masters/* $tmp/.
53 tag_signer='-u Senatus'
54 tag_message="$p release $version for $suite ($csuite) [dgit]"
55 tag_name=debian/$version
56 push_spec1="HEAD:refs/dgit/$csuite"
57 push_spec2="refs/tags/$tag_name"
58 push_spec="$push_spec1 $push_spec2"
61 git tag -f $tag_signer -m "$tag_message" $tag_name "$@"
65 cp $tmp/d[dm].* $tmp/masters
72 mustfail 'missing signature' $push_spec
75 tag_message='something'
77 mustfail 'tag message not in expected format' $push_spec
81 mustfail 'sid != sponge' HEAD:refs/dgit/sponge $push_spec2
83 # fixme test --sig-policy-url string
84 # fixme cannot test reject "signature is not of type 00!";
88 mustfail 'push is missing tag ref update' $push_spec1
89 mustfail 'push is missing head ref update' $push_spec2
90 mustfail 'pushing unexpected ref' $push_spec HEAD:refs/wombat
91 mustfail 'pushing multiple heads' $push_spec HEAD:refs/dgit/wombat
92 mustfail 'pushing multiple tags' $push_spec HEAD:refs/tags/debian/wombat
96 cp $tmp/dm.gpg $tmp/dd.gpg
97 mustfail 'key not found in keyrings' $push_spec
100 mustsucceed $push_spec # succeeds
102 mustfail 'not replacing previously-pushed version' $push_spec
107 next unless m/^fingerprint: 3A82860837A0CD32/i../^$/;
108 ' -e "$1" $tmp/dm.txt
109 tag_signer='-u Populus'
116 prep_dm_mangle 's/allow:/asponge:/i'
117 mustfail 'missing Allow section in permission' $push_spec
119 prep_dm_mangle 's/\bpari-extra\b/sponge/i'
120 mustfail "package $p not allowed for key" $push_spec
122 prep_dm_mangle 'y/0-9/5-90-4/ if m/^fingerprint:/i'
123 mustfail "not in permissions list although in keyring" $push_spec
126 mustsucceed $push_spec # succeeds