chiark / gitweb /
da40631a3fa67760fafb3dda337addcae492c99e
[dgit.git] / tests / tests / debpolicy-newreject
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
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 git reset --hard start
75 t-commit 'should require --deliberately..not-ff'
76 t-dgit build
77
78 t-expect-fail "HEAD is not a descendant of the archive's version" \
79 t-dgit push
80
81 t-expect-fail "Package is in NEW and has not been accepted or rejected yet" \
82 t-dgit --deliberately-TEST-not-fast-forward-dgit-only push
83
84 echo xxx up to here
85 echo xxx want to test database lock retry thing on push-and-taint
86 echo xxx want to test forbidden objects not present
87 echo xxx want to check expect fail did not push
88 echo xxx want to check replay prevention '(delete tag)'