Browse code

* run-tests.py, testsuite/crappy-file-name.tar.gz: Updated testsuite, work around a problem with [s3cmd cp] when the source file contains '?' or '\x7f' (where the inability to copy '?' is especially annoying).

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@420 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2010/07/08 09:04:54
Showing 3 changed files
... ...
@@ -1,5 +1,12 @@
1 1
 2010-07-08  Michal Ludvig  <mludvig@logix.net.nz>
2 2
 
3
+	* run-tests.py, testsuite/crappy-file-name.tar.gz:
4
+	  Updated testsuite, work around a problem with [s3cmd cp]
5
+	  when the source file contains '?' or '\x7f' 
6
+	  (where the inability to copy '?' is especially annoying).
7
+
8
+2010-07-08  Michal Ludvig  <mludvig@logix.net.nz>
9
+
3 10
 	* S3/Utils.py, S3/S3Uri.py: Fixed names after moving 
4 11
 	  functions between modules.
5 12
 
... ...
@@ -53,6 +53,11 @@ if have_encoding:
53 53
 else:
54 54
 	print encoding + " specific files not found."
55 55
 
56
+if not os.path.isdir('testsuite/crappy-file-name'):
57
+	os.system("tar xvz -C testsuite -f testsuite/crappy-file-name.tar.gz")
58
+	# TODO: also unpack if the tarball is newer than the directory timestamp
59
+	#       for instance when a new version was pulled from SVN.
60
+
56 61
 def test(label, cmd_args = [], retcode = 0, must_find = [], must_not_find = [], must_find_re = [], must_not_find_re = []):
57 62
 	def command_output():
58 63
 		print "----"
... ...
@@ -223,8 +228,8 @@ test_s3cmd("Buckets list", ["ls"],
223 223
 
224 224
 ## ====== Sync to S3
225 225
 test_s3cmd("Sync to S3", ['sync', 'testsuite/', 's3://s3cmd-autotest-1/xyz/', '--exclude', '.svn/*', '--exclude', '*.png', '--no-encrypt', '--exclude-from', 'testsuite/exclude.encodings' ],
226
-	must_find = [ "WARNING: 32 non-printable characters replaced in: crappy-file-name/non-printables ^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_^? +-[\]^<>%%\"'#{}`&?.end",
227
-	              "stored as 's3://s3cmd-autotest-1/xyz/crappy-file-name/non-printables ^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_^? +-[\\]^<>%%\"'#{}`&?.end'" ],
226
+	must_find = [ "WARNING: 32 non-printable characters replaced in: crappy-file-name/too-crappy ^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_^? +-[\]^<>%%\"'#{}`&?.end",
227
+	              "stored as 's3://s3cmd-autotest-1/xyz/crappy-file-name/too-crappy ^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_^? +-[\\]^<>%%\"'#{}`&?.end'" ],
228 228
 	must_not_find_re = [ "\.svn/", "\.png$" ])
229 229
 
230 230
 if have_encoding:
... ...
@@ -305,7 +310,7 @@ if have_wget:
305 305
 
306 306
 ## ====== Sync more to S3
307 307
 test_s3cmd("Sync more to S3", ['sync', 'testsuite/', 's3://s3cmd-autotest-1/xyz/', '--no-encrypt' ],
308
-	must_find = [ "File 'testsuite/.svn/format' stored as 's3://s3cmd-autotest-1/xyz/.svn/format' " ])
308
+	must_find = [ "File 'testsuite/.svn/entries' stored as 's3://s3cmd-autotest-1/xyz/.svn/entries' " ])
309 309
 
310 310
 
311 311
 ## ====== Rename within S3
... ...
@@ -324,7 +329,7 @@ test_s3cmd("Rename (NoSuchKey)", ['mv', 's3://s3cmd-autotest-1/xyz/etc/logo.png'
324 324
 test_s3cmd("Sync more from S3", ['sync', '--delete-removed', 's3://s3cmd-autotest-1/xyz', 'testsuite-out'],
325 325
 	must_find = [ "deleted: testsuite-out/logo.png",
326 326
 	              "File 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG' stored as 'testsuite-out/xyz/etc2/Logo.PNG' (22059 bytes", 
327
-	              "File 's3://s3cmd-autotest-1/xyz/.svn/format' stored as 'testsuite-out/xyz/.svn/format' " ],
327
+	              "File 's3://s3cmd-autotest-1/xyz/.svn/entries' stored as 'testsuite-out/xyz/.svn/entries' " ],
328 328
 	must_not_find_re = [ "not-deleted.*etc/logo.png" ])
329 329
 
330 330
 
... ...
@@ -355,7 +360,7 @@ test_s3cmd("Copy between buckets", ['cp', 's3://s3cmd-autotest-1/xyz/etc2/Logo.P
355 355
 	must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG copied to s3://s3cmd-Autotest-3/xyz/etc2/logo.png" ])
356 356
 
357 357
 ## ====== Recursive copy
358
-test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', 's3://s3cmd-autotest-1/xyz/', 's3://s3cmd-autotest-2/copy', '--exclude', '.svn/*'],
358
+test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', 's3://s3cmd-autotest-1/xyz/', 's3://s3cmd-autotest-2/copy', '--exclude', '.svn/*', '--exclude', 'too-crappy*'],
359 359
 	must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG copied to s3://s3cmd-autotest-2/copy/etc2/Logo.PNG",
360 360
 	              "File s3://s3cmd-autotest-1/xyz/blahBlah/Blah.txt copied to s3://s3cmd-autotest-2/copy/blahBlah/Blah.txt",
361 361
 	              "File s3://s3cmd-autotest-1/xyz/blahBlah/blah.txt copied to s3://s3cmd-autotest-2/copy/blahBlah/blah.txt" ],
... ...
@@ -392,7 +397,7 @@ test_s3cmd("Simple delete", ['del', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG'],
392 392
 ## ====== Recursive delete
393 393
 test_s3cmd("Recursive delete", ['del', '--recursive', '--exclude', 'Atomic*', 's3://s3cmd-autotest-1/xyz/etc'],
394 394
 	must_find = [ "File s3://s3cmd-autotest-1/xyz/etc/TypeRa.ttf deleted" ],
395
-	must_find_re = [ "File .*\.svn/format deleted" ],
395
+	must_find_re = [ "File .*\.svn/entries deleted" ],
396 396
 	must_not_find = [ "AtomicClockRadio.ttf" ])
397 397
 
398 398
 ## ====== Recursive delete all
399 399
Binary files a/testsuite/crappy-file-name.tar.gz and b/testsuite/crappy-file-name.tar.gz differ