From: Ian Jackson Date: Sun, 31 May 2015 14:37:30 +0000 (+0100) Subject: Test suite: add some replay prevention tests X-Git-Tag: debian/0.30~113 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=c1e9b51c128cde4b5359618c28405981d690127e;hp=0e6fdb25bacae95c16679692426b5ce7c2b150d9 Test suite: add some replay prevention tests --- diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject index b2bf6bee..bda86947 100755 --- a/tests/tests/debpolicy-newreject +++ b/tests/tests/debpolicy-newreject @@ -82,6 +82,4 @@ cd $tmp/$p echo xxx up to here echo xxx want to test database lock retry thing on push-and-taint echo xxx want to test forbidden objects not present -echo xxx want to check expect fail did not push -echo xxx want to check replay prevention insufficient proofs in tag -echo xxx want to check replay prevention removed tags file +echo xxx want to check expect fail did not push "(everywhere)" diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay new file mode 100755 index 00000000..f6053aaf --- /dev/null +++ b/tests/tests/trustingpolicy-replay @@ -0,0 +1,34 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +t-policy dgit-repos-policy-trusting +t-prep-newpackage example 1.0 + +cd $p +revision=1 +git tag start + +t-dgit build +t-dgit push --new + +t-commit 'Prep v2 which will be rewound' +t-dgit build +t-dgit push + +t-rm-dput-dropping +git checkout debian/1.0 +t-dgit build +t-dgit push --deliberately-fresh-repo + +remote="`git config dgit-distro.test-dummy.git-url`/$p.git" + +t-expect-fail 'Replay of previously-rewound upload' \ +git push "$remote" \ + debian/1.1 \ + debian/1.1~0:refs/dgit/sid + +echo ok. +echo xxx want to check replay prevention insufficient proofs in tag