chiark / gitweb /
Test suite: add some replay prevention tests
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 14:37:30 +0000 (15:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 15:06:00 +0000 (16:06 +0100)
tests/tests/debpolicy-newreject
tests/tests/trustingpolicy-replay [new file with mode: 0755]

index b2bf6bee7f411d0c6fc0eb6032752a3a74f3c5a3..bda869478059f0bc0638552607e558f214921841 100755 (executable)
@@ -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 (executable)
index 0000000..f6053aa
--- /dev/null
@@ -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