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