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