changeset 17690:eb7f8359249a

test-hybridencode: in practice, extensions aren't really unbound in length due to the fact that we only get to encode files ending in .i and .d inside the store
author Adrian Buehlmann <adrian@cadifra.com>
date Sun, 30 Sep 2012 23:53:56 +0200
parents aa0647830fd9
children c6c7e466dd3a
files tests/test-hybridencode.py tests/test-hybridencode.py.out
diffstat 2 files changed, 48 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-hybridencode.py	Mon Oct 01 21:54:04 2012 +0200
+++ b/tests/test-hybridencode.py	Sun Sep 30 23:53:56 2012 +0200
@@ -414,44 +414,49 @@
           '678/12345678/12 /xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
           '123456789-123456')
 
-print "extensions are replicated on hashed paths (unbounded!)"
+print '''Extensions are replicated on hashed paths. Note that
+we only get to encode files that end in .i or .d inside the
+store. Encoded filenames are thus bound in length.'''
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.345')
+          '123456789-12.345.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456')
+          '123456789-12.345.d')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.34567')
+          '123456789-12.3456.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.345678')
+          '123456789-12.34567.i')
+show('data/12345678/12345678/12345678/12345678/12345678/12345'
+          '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
+          '123456789-12.345678.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789')
+          '123456789-12.3456789.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789-')
+          '123456789-12.3456789-.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789-1')
+          '123456789-12.3456789-1.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789-12')
+          '123456789-12.3456789-12.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789-123')
+          '123456789-12.3456789-123.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789-1234')
+          '123456789-12.3456789-1234.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
-          '123456789-12.3456789-12345')
+          '123456789-12.3456789-12345.i')
 show('data/12345678/12345678/12345678/12345678/12345678/12345'
           '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
           '123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWX'
           'YZ-abcdefghjiklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPRSTU'
           'VWXYZ-1234567890-xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxxx'
           'xxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwww'
-          'wwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww')
+          'wwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww.i')
--- a/tests/test-hybridencode.py.out	Mon Oct 01 21:54:04 2012 +0200
+++ b/tests/test-hybridencode.py.out	Sun Sep 30 23:53:56 2012 +0200
@@ -449,40 +449,45 @@
 A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12 /xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-123456'
 B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12~20/xx-xxxxxcf79ca9795f77d7f75745da36807e5d772bd5182'
 
-extensions are replicated on hashed paths (unbounded!)
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.345'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxx50a65dfc4ab6bf5fb9ba949447ccaf456c1ebf30.345'
+Extensions are replicated on hashed paths. Note that
+we only get to encode files that end in .i or .d inside the
+store. Encoded filenames are thus bound in length.
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.345.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxc10ad03b5755ed524f5286aab1815dfe07729438.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxe5f03f29a0a5876660a28aefc43f978add5a7659.3456'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.345.d'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxx9eec83381f2b39ef5ac8b4ecdf2c94f7983f57c8.d'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.34567'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xc2609a92347e5a14c29211c6cd634732d1f0c968.34567'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxb7796dc7d175cfb0bb8a7728f58f6ebec9042568.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.345678'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-695e97d34c6cd8186afa3c74a56243bd645d50c3.345678'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.34567.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxb515857a6bfeef017c4894d8df42458ac65d55b8.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/b067582449be78bc1266e9195785a5c6165380e6.3456789'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.345678.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxb05a0f247bc0a776211cd6a32ab714fd9cc09f2b.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/d3442b4cfe1fdbde1c4c60ad421e946344111961.3456789-'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxf192b48bff08d9e0e12035fb52bc58c70de72c94.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-1'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/40a78aaf2114e1b82f91ac3ff234bf358d99dbba.3456789-1'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxx435551e0ed4c7b083b9ba83cee916670e02e80ad.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/1e04221e6fbff8cfbeaf555d11550dc573e3326d.3456789-12'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-1.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxa7f74eb98d8d58b716356dfd26e2f9aaa65d6a9a.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-123'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/5e3b3973b3c9297b4577a4cf1d58162545a6b454.3456789-123'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxed68d9bd43b931f0b100267fee488d65a0c66f62.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-1234'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/6ee6ef477c7ba44ff19c7d97fc4ac7fa4a8e4665.3456789-1234'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-123.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxx5cea44de2b642d2ba2b4a30693ffb1049644d698.i'
+
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-1234.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxx68462f62a7f230b39c1b5400d73ec35920990b7e.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/f08b927027344ec4a7f1994ecb0effe2b9cc1215.3456789-12345'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxx4cb852a314c6da240a83eec94761cdd71c6ec22e.i'
 
-A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPRSTUVWXYZ-1234567890-xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxxxxxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww'
-B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/28de8651e30eeb95f4b97edb7d12b281d3fb3ce0.3456789-12345-abcdefghijklmnoprstuvwxyz-abcdefghjiklmnopqrstuvwxyz-abcdefghijklmnoprstuvwxyz-1234567890-xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxxxxxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww'
+A = 'data/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPRSTUVWXYZ-1234567890-xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxxxxxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww.i'
+B = 'dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/-xxxxx93352aa50377751d9e5ebdf52da1e6e69a6887a6.i'