Debian Codegraph @

tests/test-remotefilelog-permissions.t

raw
1 #require no-windows
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
5 $ hg init master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
9 > server=True
10 > EOF
11 $ echo x > x
12 $ hg commit -qAm x
13
14 $ cd ..
15
16 $ hgcloneshallow ssh://user@dummy/master shallow -q
17 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
18
19 $ cd master
20 $ echo xx > x
21 $ hg commit -qAm x2
22 $ cd ..
23
24 # Test cache misses with read only permissions on server
25
26 $ chmod -R a-w master/.hg/remotefilelogcache
27 $ cd shallow
28 $ hg pull -q
29 $ hg update
30 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
32 $ cd ..
33
34 $ chmod -R u+w master/.hg/remotefilelogcache
35
36 #if suidbit
37
38 # Test setting up shared cache with the right permissions
39 # (this is hard to test in a cross platform way, so we just make sure nothing
40 # crashes)
41
42 $ rm -rf $CACHEDIR
43 $ umask 002
44 $ mkdir $CACHEDIR
45 $ hg -q clone --shallow ssh://user@dummy/master shallow2 --config remotefilelog.cachegroup="`id -g -n`"
46 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
47 $ ls -ld $CACHEDIR/11
48 drwxrws* $TESTTMP/hgcache/11 (glob)
49
50 #endif