##// END OF EJS Templates
remotefilelog: tweak corrupt cache test to grep more flexibly...
Augie Fackler -
r48337:5830539c default
parent child Browse files
Show More
@@ -1,72 +1,72
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ echo y > y
12 $ echo y > y
13 $ echo z > z
13 $ echo z > z
14 $ hg commit -qAm xy
14 $ hg commit -qAm xy
15
15
16 $ cd ..
16 $ cd ..
17
17
18 $ hgcloneshallow ssh://user@dummy/master shallow -q
18 $ hgcloneshallow ssh://user@dummy/master shallow -q
19 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
19 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
20 $ cd shallow
20 $ cd shallow
21
21
22 Verify corrupt cache handling repairs by default
22 Verify corrupt cache handling repairs by default
23
23
24 $ hg up -q null
24 $ hg up -q null
25 $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
25 $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
26 $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
26 $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
27 $ hg up tip
27 $ hg up tip
28 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
29 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
30
30
31 Verify corrupt cache error message
31 Verify corrupt cache error message
32
32
33 $ hg up -q null
33 $ hg up -q null
34 $ cat >> .hg/hgrc <<EOF
34 $ cat >> .hg/hgrc <<EOF
35 > [remotefilelog]
35 > [remotefilelog]
36 > validatecache=off
36 > validatecache=off
37 > EOF
37 > EOF
38 $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
38 $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
39 $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
39 $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
40 $ hg up tip 2>&1 | egrep "^RuntimeError"
40 $ hg up tip 2>&1 | egrep "^[^ ].*unexpected remotefilelog"
41 RuntimeError: unexpected remotefilelog header: illegal format
41 RuntimeError: unexpected remotefilelog header: illegal format
42
42
43 Verify detection and remediation when remotefilelog.validatecachelog is set
43 Verify detection and remediation when remotefilelog.validatecachelog is set
44
44
45 $ cat >> .hg/hgrc <<EOF
45 $ cat >> .hg/hgrc <<EOF
46 > [remotefilelog]
46 > [remotefilelog]
47 > validatecachelog=$PWD/.hg/remotefilelog_cache.log
47 > validatecachelog=$PWD/.hg/remotefilelog_cache.log
48 > validatecache=strict
48 > validatecache=strict
49 > EOF
49 > EOF
50 $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
50 $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
51 $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
51 $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
52 $ hg up tip
52 $ hg up tip
53 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
54 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
55 $ cat .hg/remotefilelog_cache.log
55 $ cat .hg/remotefilelog_cache.log
56 corrupt $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 during contains
56 corrupt $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 during contains
57
57
58 Verify handling of corrupt server cache
58 Verify handling of corrupt server cache
59
59
60 $ rm -f ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
60 $ rm -f ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
61 $ touch ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
61 $ touch ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
62 $ clearcache
62 $ clearcache
63 $ hg prefetch -r .
63 $ hg prefetch -r .
64 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
64 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
65 $ test -s ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
65 $ test -s ../master/.hg/remotefilelogcache/y/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
66 $ hg debugremotefilelog $CACHEDIR/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
66 $ hg debugremotefilelog $CACHEDIR/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
67 size: 2 bytes
67 size: 2 bytes
68 path: $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
68 path: $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
69 key: 076f5e2225b3
69 key: 076f5e2225b3
70
70
71 node => p1 p2 linknode copyfrom
71 node => p1 p2 linknode copyfrom
72 076f5e2225b3 => 000000000000 000000000000 f3d0bb0d1e48
72 076f5e2225b3 => 000000000000 000000000000 f3d0bb0d1e48
General Comments 0
You need to be logged in to leave comments. Login now