chiark / gitweb /
Test suite: test forbidden objects not present
[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_expect_push_fail_hook+='
22 t-git-objects-not-present "" $bad
23 '
24
25 t-dgit build
26 t-expect-push-fail 'forbidden for testing' \
27 t-dgit push --new
28 t-git-dir-check enoent
29
30 git reset --hard start
31 t-commit 'will vanish from NEW'
32 vanished=$v
33 t-dgit build
34 t-dgit push --new
35 t-git-dir-check secret
36
37 t-policy-periodic
38 t-git-dir-check secret
39
40 # pretend it vanished from new:
41 rm $tmp/incoming/*
42 t-archive-none example
43
44 t-git-dir-time-passes
45
46 t-policy-periodic
47 t-git-dir-check enoent
48
49 t-commit 'should require --deliberately...questionable'
50 t-dgit build
51
52 t-expect-push-fail E:"tag debian/${vanished//./\\.} referred to this object.*all previously pushed versions were found to have been removed" \
53 t-dgit push --new
54 t-git-dir-check enoent
55
56 t-dgit push --new --deliberately-include-questionable-history
57 t-git-dir-check secret
58
59 t-policy-periodic
60 t-git-dir-check secret
61
62 t-archive-process-incoming new
63 t-git-dir-time-passes
64
65 t-policy-periodic
66 t-git-dir-check secret
67
68 oldobj=`git rev-parse HEAD`
69 git reset --hard start
70 t-commit 'should require --deliberately..not-ff'
71 t-dgit build
72
73 t-expect-push-fail "HEAD is not a descendant of the archive's version" \
74 t-dgit push
75
76 t-expect-push-fail "Package is in NEW and has not been accepted or rejected yet" \
77 t-dgit --deliberately-TEST-dgit-only-not-fast-forward push
78
79 t-dgit --deliberately-not-fast-forward push
80
81 cd $tmp/git/$p.git
82 t-expect-push-fail "Not a valid object name" \
83 git cat-file -p $oldobj
84 cd $tmp/$p
85
86 echo xxx up to here
87 echo xxx want to test database lock retry thing on push-and-taint
88 echo xxx want to t-expect-push-fail leaves HEAD object not dest repo