##// END OF EJS Templates
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht -
r7554:11a4eb81 1.1.2 default
parent child Browse files
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -1,23 +1,44
1 #!/bin/sh
1 #!/bin/sh
2
2
3 hg init
3 hg init
4
4
5 echo % should fail
5 echo % should fail
6 hg add .hg/00changelog.i
6 hg add .hg/00changelog.i
7
7
8 mkdir a
8 mkdir a
9 echo a > a/a
9 echo a > a/a
10 hg ci -Ama
10 hg ci -Ama
11 ln -s a b
11 ln -s a b
12 echo b > a/b
12 echo b > a/b
13
13
14 echo % should fail
14 echo % should fail
15 hg add b/b
15 hg add b/b
16
16
17 echo % should succeed
17 echo % should succeed
18 hg add b
18 hg add b
19
19
20 echo % should still fail - maybe
20 echo % should still fail - maybe
21 hg add b/b
21 hg add b/b
22
22
23 echo % unbundle tampered bundle
24 hg init target
25 cd target
26 hg unbundle $TESTDIR/tampered.hg
27
28 echo % attack .hg/test
29 hg manifest -r0
30 hg update -Cr0
31
32 echo % attack foo/.hg/test
33 hg manifest -r1
34 hg update -Cr1
35
36 echo % attack back/test where back symlinks to ..
37 hg manifest -r2
38 hg update -Cr2
39
40 echo % attack ../test
41 hg manifest -r3
42 hg update -Cr3
43
23 exit 0
44 exit 0
@@ -1,8 +1,27
1 % should fail
1 % should fail
2 abort: path contains illegal component: .hg/00changelog.i
2 abort: path contains illegal component: .hg/00changelog.i
3 adding a/a
3 adding a/a
4 % should fail
4 % should fail
5 abort: path 'b/b' traverses symbolic link 'b'
5 abort: path 'b/b' traverses symbolic link 'b'
6 % should succeed
6 % should succeed
7 % should still fail - maybe
7 % should still fail - maybe
8 abort: path 'b/b' traverses symbolic link 'b'
8 abort: path 'b/b' traverses symbolic link 'b'
9 % unbundle tampered bundle
10 adding changesets
11 adding manifests
12 adding file changes
13 added 4 changesets with 5 changes to 5 files (+3 heads)
14 (run 'hg heads' to see heads, 'hg merge' to merge)
15 % attack .hg/test
16 .hg/test
17 abort: path contains illegal component: .hg/test
18 % attack foo/.hg/test
19 foo/.hg/test
20 abort: path 'foo/.hg/test' is inside repo 'foo'
21 % attack back/test where back symlinks to ..
22 back
23 back/test
24 abort: path 'back/test' traverses symbolic link 'back'
25 % attack ../test
26 ../test
27 abort: path contains illegal component: ../test
General Comments 0
You need to be logged in to leave comments. Login now