annotate tests/test-audit-path @ 7708:a32847fa0df0

wire protocol: avoid infinite loop (issue1483)
author Matt Mackall <mpm@selenic.com>
date Sun, 25 Jan 2009 10:16:45 -0600
parents 11a4eb81fb4f
children e9d3a11eacad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
1 #!/bin/sh
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
2
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
3 hg init
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
4
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
5 echo % should fail
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
6 hg add .hg/00changelog.i
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
7
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
8 mkdir a
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
9 echo a > a/a
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
10 hg ci -Ama
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
11 ln -s a b
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
12 echo b > a/b
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
13
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
14 echo % should fail
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
15 hg add b/b
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
16
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
17 echo % should succeed
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
18 hg add b
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
19
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
20 echo % should still fail - maybe
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
21 hg add b/b
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
22
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
23 echo % unbundle tampered bundle
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
24 hg init target
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
25 cd target
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
26 hg unbundle $TESTDIR/tampered.hg
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
27
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
28 echo % attack .hg/test
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
29 hg manifest -r0
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
30 hg update -Cr0
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
31
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
32 echo % attack foo/.hg/test
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
33 hg manifest -r1
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
34 hg update -Cr1
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
35
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
36 echo % attack back/test where back symlinks to ..
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
37 hg manifest -r2
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
38 hg update -Cr2
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
39
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
40 echo % attack ../test
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
41 hg manifest -r3
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
42 hg update -Cr3
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
43
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
44 exit 0