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