##// END OF EJS Templates
tests: add a rewriting step to detect EACCES errors
Arseniy Alekseyev -
r51215:adecb1ab stable
parent child Browse files
Show More
@@ -136,6 +136,11 b' substitutions = ['
136 # FormatMessage(ERROR_FILE_NOT_FOUND)
136 # FormatMessage(ERROR_FILE_NOT_FOUND)
137 br'The system cannot find the file specified',
137 br'The system cannot find the file specified',
138 ),
138 ),
139 br'$EACCES$': (
140 br'Permission denied \(os error 13\)',
141 # strerror
142 br'Permission denied',
143 ),
139 br'$ENOTDIR$': (
144 br'$ENOTDIR$': (
140 # strerror()
145 # strerror()
141 br'Not a directory',
146 br'Not a directory',
@@ -322,8 +322,8 b' Skip rotation if the .hg is read-only'
322 #if unix-permissions
322 #if unix-permissions
323 $ chmod -w .hg
323 $ chmod -w .hg
324 $ hg log -r. -T '{rev}\n' --config blackbox.maxsize=1 --debug
324 $ hg log -r. -T '{rev}\n' --config blackbox.maxsize=1 --debug
325 warning: cannot rename '$TESTTMP/blackboxtest3/.hg/blackbox.log.1' to '$TESTTMP/blackboxtest3/.hg/blackbox.log': Permission denied
325 warning: cannot rename '$TESTTMP/blackboxtest3/.hg/blackbox.log.1' to '$TESTTMP/blackboxtest3/.hg/blackbox.log': $EACCES$
326 warning: cannot write to blackbox.log: Permission denied
326 warning: cannot write to blackbox.log: $EACCES$
327 1
327 1
328 $ chmod +w .hg
328 $ chmod +w .hg
329 #endif
329 #endif
@@ -633,7 +633,7 b' Inaccessible source'
633 $ mkdir a
633 $ mkdir a
634 $ chmod 000 a
634 $ chmod 000 a
635 $ hg clone a b
635 $ hg clone a b
636 abort: Permission denied: *$TESTTMP/fail/a/.hg* (glob)
636 abort: $EACCES$: *$TESTTMP/fail/a/.hg* (glob)
637 [255]
637 [255]
638
638
639 Inaccessible destination
639 Inaccessible destination
@@ -641,7 +641,7 b' Inaccessible destination'
641 $ hg init b
641 $ hg init b
642 $ cd b
642 $ cd b
643 $ hg clone . ../a
643 $ hg clone . ../a
644 abort: Permission denied: *../a* (glob)
644 abort: $EACCES$: *../a* (glob)
645 [255]
645 [255]
646 $ cd ..
646 $ cd ..
647 $ chmod 700 a
647 $ chmod 700 a
@@ -468,7 +468,7 b' conversion to dir without permissions sh'
468 $ chmod 000 bogusdir
468 $ chmod 000 bogusdir
469
469
470 $ hg convert a bogusdir
470 $ hg convert a bogusdir
471 abort: Permission denied: *bogusdir* (glob)
471 abort: $EACCES$: *bogusdir* (glob)
472 [255]
472 [255]
473
473
474 user permissions should succeed
474 user permissions should succeed
@@ -59,7 +59,7 b' Check %include'
59 #if unix-permissions no-root
59 #if unix-permissions no-root
60 $ chmod u-r $TESTTMP/included
60 $ chmod u-r $TESTTMP/included
61 $ hg showconfig section
61 $ hg showconfig section
62 config error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included (Permission denied*) (glob)
62 config error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included ($EACCES$*) (glob)
63 [255]
63 [255]
64 #endif
64 #endif
65
65
@@ -47,7 +47,7 b' Check that zero-size journals are correc'
47
47
48 $ hg -R foo unbundle repo.hg
48 $ hg -R foo unbundle repo.hg
49 adding changesets
49 adding changesets
50 abort: Permission denied: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
50 abort: $EACCES$: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
51 [255]
51 [255]
52
52
53 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
53 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
@@ -135,7 +135,7 b' Pushing to a local read-only repo that c'
135 $ hg -R b push a
135 $ hg -R b push a
136 pushing to a
136 pushing to a
137 searching for changes
137 searching for changes
138 abort: could not lock repository a: Permission denied
138 abort: could not lock repository a: $EACCES$
139 [20]
139 [20]
140
140
141 $ chmod 700 a/.hg/store
141 $ chmod 700 a/.hg/store
@@ -24,7 +24,7 b''
24 $ chmod -r .hg/store/data/a.i
24 $ chmod -r .hg/store/data/a.i
25
25
26 $ hg verify -q
26 $ hg verify -q
27 abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
27 abort: $EACCES$: '$TESTTMP/t/.hg/store/data/a.i'
28 [255]
28 [255]
29
29
30 $ chmod +r .hg/store/data/a.i
30 $ chmod +r .hg/store/data/a.i
@@ -36,7 +36,7 b''
36 $ echo barber > a
36 $ echo barber > a
37 $ hg commit -m "2"
37 $ hg commit -m "2"
38 trouble committing a!
38 trouble committing a!
39 abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
39 abort: $EACCES$: '$TESTTMP/t/.hg/store/data/a.i'
40 [255]
40 [255]
41
41
42 $ chmod -w .
42 $ chmod -w .
@@ -64,7 +64,7 b''
64 (fsmonitor makes "hg status" avoid accessing to "dir")
64 (fsmonitor makes "hg status" avoid accessing to "dir")
65
65
66 $ hg status
66 $ hg status
67 dir: Permission denied* (glob)
67 dir: $EACCES$* (glob)
68 M a
68 M a
69
69
70 #endif
70 #endif
@@ -53,9 +53,9 b''
53 transaction abort!
53 transaction abort!
54 failed to truncate data/b.i
54 failed to truncate data/b.i
55 rollback failed - please run hg recover
55 rollback failed - please run hg recover
56 (failure reason: [Errno *] Permission denied .hg/store/data/b.i') (glob)
56 (failure reason: [Errno *] $EACCES$ .hg/store/data/b.i') (glob)
57 strip failed, backup bundle
57 strip failed, backup bundle
58 abort: Permission denied .hg/store/data/b.i'
58 abort: $EACCES$ .hg/store/data/b.i'
59 % after update 0, strip 2
59 % after update 0, strip 2
60 abandoned transaction found - run hg recover
60 abandoned transaction found - run hg recover
61 checking changesets
61 checking changesets
@@ -89,7 +89,7 b''
89 date: Thu Jan 01 00:00:00 1970 +0000
89 date: Thu Jan 01 00:00:00 1970 +0000
90 summary: a
90 summary: a
91
91
92 abort: Permission denied .hg/store/data/b.i'
92 abort: $EACCES$ .hg/store/data/b.i'
93 % after update 0, strip 2
93 % after update 0, strip 2
94 checking changesets
94 checking changesets
95 checking manifests
95 checking manifests
@@ -110,9 +110,9 b''
110 transaction abort!
110 transaction abort!
111 failed to truncate 00manifest.i
111 failed to truncate 00manifest.i
112 rollback failed - please run hg recover
112 rollback failed - please run hg recover
113 (failure reason: [Errno *] Permission denied .hg/store/00manifest.i') (glob)
113 (failure reason: [Errno *] $EACCES$ .hg/store/00manifest.i') (glob)
114 strip failed, backup bundle
114 strip failed, backup bundle
115 abort: Permission denied .hg/store/00manifest.i'
115 abort: $EACCES$ .hg/store/00manifest.i'
116 % after update 0, strip 2
116 % after update 0, strip 2
117 abandoned transaction found - run hg recover
117 abandoned transaction found - run hg recover
118 checking changesets
118 checking changesets
@@ -403,9 +403,9 b' Test hg-ssh in read-only mode:'
403 $ hg push --ssh "sh ../ssh.sh"
403 $ hg push --ssh "sh ../ssh.sh"
404 pushing to ssh://user@dummy/*/remote (glob)
404 pushing to ssh://user@dummy/*/remote (glob)
405 searching for changes
405 searching for changes
406 remote: Permission denied
406 remote: $EACCES$
407 remote: abort: pretxnopen.hg-ssh hook failed
407 remote: abort: pretxnopen.hg-ssh hook failed
408 remote: Permission denied
408 remote: $EACCES$
409 remote: pushkey-abort: prepushkey.hg-ssh hook failed
409 remote: pushkey-abort: prepushkey.hg-ssh hook failed
410 updating 6c0482d977a3 to public failed!
410 updating 6c0482d977a3 to public failed!
411 [1]
411 [1]
@@ -13,7 +13,7 b' repository itself is non-readable'
13 $ chmod a-rx no-read
13 $ chmod a-rx no-read
14
14
15 $ hg id ssh://user@dummy/no-read
15 $ hg id ssh://user@dummy/no-read
16 remote: abort: Permission denied: *$TESTTMP/no-read/.hg* (glob)
16 remote: abort: $EACCES$: *$TESTTMP/no-read/.hg* (glob)
17 abort: no suitable response from remote hg
17 abort: no suitable response from remote hg
18 [255]
18 [255]
19
19
@@ -31,7 +31,7 b' seems an unexpected case in real life, b'
31 > done
31 > done
32
32
33 $ hg id ssh://user@dummy/other
33 $ hg id ssh://user@dummy/other
34 remote: abort: Permission denied: '$TESTTMP/other/.hg/requires'
34 remote: abort: $EACCES$: '$TESTTMP/other/.hg/requires'
35 abort: no suitable response from remote hg
35 abort: no suitable response from remote hg
36 [255]
36 [255]
37
37
@@ -47,7 +47,7 b' directory toward the repository is read '
47 $ chmod a-rx deep
47 $ chmod a-rx deep
48
48
49 $ hg id ssh://user@dummy/deep/nested
49 $ hg id ssh://user@dummy/deep/nested
50 remote: abort: Permission denied: *$TESTTMP/deep/nested/.hg* (glob)
50 remote: abort: $EACCES$: *$TESTTMP/deep/nested/.hg* (glob)
51 abort: no suitable response from remote hg
51 abort: no suitable response from remote hg
52 [255]
52 [255]
53
53
@@ -456,7 +456,7 b' Test hg-ssh in read-only mode:'
456 $ hg push --ssh "sh ../ssh.sh"
456 $ hg push --ssh "sh ../ssh.sh"
457 pushing to ssh://user@dummy/*/remote (glob)
457 pushing to ssh://user@dummy/*/remote (glob)
458 searching for changes
458 searching for changes
459 remote: Permission denied
459 remote: $EACCES$
460 remote: pretxnopen.hg-ssh hook failed
460 remote: pretxnopen.hg-ssh hook failed
461 abort: push failed on remote
461 abort: push failed on remote
462 [100]
462 [100]
@@ -849,7 +849,7 b' entirely:'
849
849
850 $ chmod 0 subdir
850 $ chmod 0 subdir
851 $ hg status --include subdir
851 $ hg status --include subdir
852 subdir: Permission denied
852 subdir: $EACCES$
853 R subdir/removed
853 R subdir/removed
854 ! subdir/clean
854 ! subdir/clean
855 ! subdir/deleted
855 ! subdir/deleted
@@ -1260,7 +1260,7 b' Error if style not readable:'
1260 $ touch q
1260 $ touch q
1261 $ chmod 0 q
1261 $ chmod 0 q
1262 $ hg log --style ./q
1262 $ hg log --style ./q
1263 abort: Permission denied: './q'
1263 abort: $EACCES$: './q'
1264 [255]
1264 [255]
1265 #endif
1265 #endif
1266
1266
@@ -1309,7 +1309,7 b' Error if include fails:'
1309 $ echo 'changeset = q' >> t
1309 $ echo 'changeset = q' >> t
1310 #if unix-permissions no-root
1310 #if unix-permissions no-root
1311 $ hg log --style ./t
1311 $ hg log --style ./t
1312 abort: template file ./q: Permission denied
1312 abort: template file ./q: $EACCES$
1313 [255]
1313 [255]
1314 $ rm -f q
1314 $ rm -f q
1315 #endif
1315 #endif
General Comments 0
You need to be logged in to leave comments. Login now