chiark / gitweb /
Tests: debpolicy-newreject: Attempt push while still in new
[dgit.git] / tests / tests / debpolicy-newreject
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-debpolicy
6 t-prep-newpackage example 1.0
7
8 cd $p
9
10 revision=1
11 t-commit () {
12         local msg=$1
13         v=1.$revision
14         dch -v$v --distribution unstable "$1"
15         git add debian/changelog
16         debcommit
17         revision=$(( $revision + 1 ))
18 }
19
20 git tag start
21
22 echo FORBIDDEN >debian/some-file
23 git add debian/some-file
24 t-commit 'Commit a forbidden thing'
25
26 bad=`git rev-parse HEAD:debian/some-file`
27 t-policy-admin taint --global "$bad" "forbidden for testing"
28
29 t-dgit build
30 t-expect-fail 'forbidden for testing' \
31 t-dgit push --new
32 t-git-dir-check enoent
33
34 git reset --hard start
35 t-commit 'will vanish from NEW'
36 vanished=$v
37 t-dgit build
38 t-dgit push --new
39 t-git-dir-check secret
40
41 t-policy-periodic
42 t-git-dir-check secret
43
44 # pretend it vanished from new:
45 rm $tmp/incoming/*
46 t-archive-none example
47
48 t-git-dir-time-passes
49
50 t-policy-periodic
51 t-git-dir-check enoent
52
53 t-commit 'should require --deliberately...questionable'
54 t-dgit build
55
56 t-expect-fail "tag debian/$vanished referred to this object.*all previously pushed versions were found to have been removed" \
57 t-dgit push --new
58 t-git-dir-check enoent
59
60 t-dgit push --new --deliberately-include-questionable-history
61 t-git-dir-check secret
62
63 t-policy-periodic
64 t-git-dir-check secret
65
66 t-archive-process-incoming new
67 t-git-dir-time-passes
68
69 t-policy-periodic
70 t-git-dir-check secret
71
72 git reset --hard start
73 t-commit 'should require --deliberately..not-ff'
74 t-dgit build
75
76 t-expect-fail "HEAD is not a descendant of the archive's version" \
77 t-dgit push
78
79 t-expect-fail "Package is in NEW and has not been accepted or rejected yet" \
80 t-dgit --deliberately-TEST-not-fast-forward-dgit-only push
81
82 echo xxx up to here
83 echo xxx want to test database lock retry thing on push-and-taint
84 echo xxx want to test forbidden objects not present
85 echo xxx want to check expect fail did not push
86 echo xxx want to check replay prevention '(delete tag)'