1) Use EX_PARTIAL return code in a lot of places. The unreadable file
was causing return codes of EX_PARTIAL instead of 0 as expected.
2) The string "File: '%s' saved as '%s'" has changed to simply "%s ->
%s" so fix all the expected responses.
This doesn't resolve all errors. There is still one failed return code
renaming a non-existant file, which needs to get tracked down. That
returns EX_PARTIAL instead of "file not found" as expeted. But that's
the wrong return code.
... | ... |
@@ -317,15 +317,16 @@ test_s3cmd("Buckets list", ["ls"], |
317 | 317 |
|
318 | 318 |
## ====== Sync to S3 |
319 | 319 |
test_s3cmd("Sync to S3", ['sync', 'testsuite/', pbucket(1) + '/xyz/', '--exclude', 'demo/*', '--exclude', '*.png', '--no-encrypt', '--exclude-from', 'testsuite/exclude.encodings' ], |
320 |
- 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", |
|
321 |
- "WARNING: File can not be uploaded: testsuite/permission-tests/permission-denied.txt: Permission denied", |
|
322 |
- "stored as '%s/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'" % pbucket(1) ], |
|
323 |
- must_not_find_re = [ "demo/", "\.png$", "permission-denied-dir" ]) |
|
320 |
+ must_find = [ "WARNING: File can not be uploaded: testsuite/permission-tests/permission-denied.txt: Permission denied", |
|
321 |
+ "WARNING: 32 non-printable characters replaced in: crappy-file-name/non-printables", |
|
322 |
+ ], |
|
323 |
+ must_not_find_re = [ "demo/", "\.png$", "permission-denied-dir" ], |
|
324 |
+ retcode = EX_PARTIAL) |
|
324 | 325 |
|
325 | 326 |
if have_encoding: |
326 | 327 |
## ====== Sync UTF-8 / GBK / ... to S3 |
327 | 328 |
test_s3cmd("Sync %s to S3" % encoding, ['sync', 'testsuite/encodings/' + encoding, '%s/xyz/encodings/' % pbucket(1), '--exclude', 'demo/*', '--no-encrypt' ], |
328 |
- must_find = [ u"File 'testsuite/encodings/%(encoding)s/%(pattern)s' stored as '%(pbucket)s/xyz/encodings/%(encoding)s/%(pattern)s'" % { 'encoding' : encoding, 'pattern' : enc_pattern , 'pbucket' : pbucket(1)} ]) |
|
329 |
+ must_find = [ u"testsuite/encodings/%(encoding)s/%(pattern)s -> %(pbucket)s/xyz/encodings/%(encoding)s/%(pattern)s" % { 'encoding' : encoding, 'pattern' : enc_pattern , 'pbucket' : pbucket(1)} ]) |
|
329 | 330 |
|
330 | 331 |
|
331 | 332 |
## ====== List bucket content |
... | ... |
@@ -353,7 +354,7 @@ test_flushdir("Clean testsuite-out/", "testsuite-out") |
353 | 353 |
## ====== Put from stdin |
354 | 354 |
f = open('testsuite/single-file/single-file.txt', 'r') |
355 | 355 |
test_s3cmd("Put from stdin", ['put', '-', '%s/single-file/single-file.txt' % pbucket(1)], |
356 |
- must_find = ["File '-' stored as '%s/single-file/single-file.txt'" % pbucket(1)], |
|
356 |
+ must_find = ["<stdin> -> %s/single-file/single-file.txt" % pbucket(1)], |
|
357 | 357 |
stdin = f) |
358 | 358 |
f.close() |
359 | 359 |
|
... | ... |
@@ -374,9 +375,9 @@ f.close() |
374 | 374 |
test_flushdir("Clean testsuite-out/", "testsuite-out") |
375 | 375 |
|
376 | 376 |
## ====== Sync from S3 |
377 |
-must_find = [ "File '%s/xyz/binary/random-crap.md5' stored as 'testsuite-out/xyz/binary/random-crap.md5'" % pbucket(1) ] |
|
377 |
+must_find = [ "%s/xyz/binary/random-crap.md5 -> testsuite-out/xyz/binary/random-crap.md5" % pbucket(1) ] |
|
378 | 378 |
if have_encoding: |
379 |
- must_find.append(u"File '%(pbucket)s/xyz/encodings/%(encoding)s/%(pattern)s' stored as 'testsuite-out/xyz/encodings/%(encoding)s/%(pattern)s' " % { 'encoding' : encoding, 'pattern' : enc_pattern, 'pbucket' : pbucket(1) }) |
|
379 |
+ must_find.append(u"%(pbucket)s/xyz/encodings/%(encoding)s/%(pattern)s -> testsuite-out/xyz/encodings/%(encoding)s/%(pattern)s " % { 'encoding' : encoding, 'pattern' : enc_pattern, 'pbucket' : pbucket(1) }) |
|
380 | 380 |
test_s3cmd("Sync from S3", ['sync', '%s/xyz' % pbucket(1), 'testsuite-out'], |
381 | 381 |
must_find = must_find) |
382 | 382 |
|
... | ... |
@@ -391,7 +392,8 @@ test_mkdir("Create file-dir dir", "testsuite-out/xyz/dir-test/file-dir") |
391 | 391 |
|
392 | 392 |
## ====== Skip dst dirs |
393 | 393 |
test_s3cmd("Skip over dir", ['sync', '%s/xyz' % pbucket(1), 'testsuite-out'], |
394 |
- must_find = "WARNING: testsuite-out/xyz/dir-test/file-dir is a directory - skipping over") |
|
394 |
+ must_find = "WARNING: testsuite-out/xyz/dir-test/file-dir is a directory - skipping over", |
|
395 |
+ retcode = EX_PARTIAL) |
|
395 | 396 |
|
396 | 397 |
|
397 | 398 |
## ====== Clean up local destination dir |
... | ... |
@@ -400,7 +402,7 @@ test_flushdir("Clean testsuite-out/", "testsuite-out") |
400 | 400 |
|
401 | 401 |
## ====== Put public, guess MIME |
402 | 402 |
test_s3cmd("Put public, guess MIME", ['put', '--guess-mime-type', '--acl-public', 'testsuite/etc/logo.png', '%s/xyz/etc/logo.png' % pbucket(1)], |
403 |
- must_find = [ "stored as '%s/xyz/etc/logo.png'" % pbucket(1) ]) |
|
403 |
+ must_find = [ "-> %s/xyz/etc/logo.png" % pbucket(1) ]) |
|
404 | 404 |
|
405 | 405 |
|
406 | 406 |
## ====== Retrieve from URL |
... | ... |
@@ -434,21 +436,24 @@ if have_wget: |
434 | 434 |
|
435 | 435 |
## ====== Sync more to S3 |
436 | 436 |
test_s3cmd("Sync more to S3", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt' ], |
437 |
- must_find = [ "File 'testsuite/demo/some-file.xml' stored as '%s/xyz/demo/some-file.xml' " % pbucket(1) ], |
|
438 |
- must_not_find = [ "File 'testsuite/etc/linked.png' stored as '%s/xyz/etc/linked.png" % pbucket(1) ]) |
|
437 |
+ must_find = [ "testsuite/demo/some-file.xml -> %s/xyz/demo/some-file.xml " % pbucket(1) ], |
|
438 |
+ must_not_find = [ "testsuite/etc/linked.png -> %s/xyz/etc/linked.png" % pbucket(1) ], |
|
439 |
+ retcode = EX_PARTIAL) |
|
439 | 440 |
|
440 | 441 |
|
441 | 442 |
## ====== Don't check MD5 sum on Sync |
442 | 443 |
test_copy("Change file cksum1.txt", "testsuite/checksum/cksum2.txt", "testsuite/checksum/cksum1.txt") |
443 | 444 |
test_copy("Change file cksum33.txt", "testsuite/checksum/cksum2.txt", "testsuite/checksum/cksum33.txt") |
444 | 445 |
test_s3cmd("Don't check MD5", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--no-check-md5'], |
445 |
- must_find = [ "cksum33.txt" ], |
|
446 |
- must_not_find = [ "cksum1.txt" ]) |
|
446 |
+ must_find = [ "cksum33.txt" ], |
|
447 |
+ must_not_find = [ "cksum1.txt" ], |
|
448 |
+ retcode = EX_PARTIAL) |
|
447 | 449 |
|
448 | 450 |
|
449 | 451 |
## ====== Check MD5 sum on Sync |
450 | 452 |
test_s3cmd("Check MD5", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--check-md5'], |
451 |
- must_find = [ "cksum1.txt" ]) |
|
453 |
+ must_find = [ "cksum1.txt" ], |
|
454 |
+ retcode = EX_PARTIAL) |
|
452 | 455 |
|
453 | 456 |
|
454 | 457 |
## ====== Rename within S3 |
... | ... |
@@ -469,8 +474,8 @@ test_s3cmd("Sync more from S3 (invalid src)", ['sync', '--delete-removed', '%s/x |
469 | 469 |
## ====== Sync more from S3 |
470 | 470 |
test_s3cmd("Sync more from S3", ['sync', '--delete-removed', '%s/xyz' % pbucket(1), 'testsuite-out'], |
471 | 471 |
must_find = [ "deleted: testsuite-out/logo.png", |
472 |
- "File '%s/xyz/etc2/Logo.PNG' stored as 'testsuite-out/xyz/etc2/Logo.PNG' (22059 bytes" % pbucket(1), |
|
473 |
- "File '%s/xyz/demo/some-file.xml' stored as 'testsuite-out/xyz/demo/some-file.xml' " % pbucket(1) ], |
|
472 |
+ "%s/xyz/etc2/Logo.PNG -> testsuite-out/xyz/etc2/Logo.PNG" % pbucket(1), |
|
473 |
+ "%s/xyz/demo/some-file.xml -> testsuite-out/xyz/demo/some-file.xml" % pbucket(1) ], |
|
474 | 474 |
must_not_find_re = [ "not-deleted.*etc/logo.png" ]) |
475 | 475 |
|
476 | 476 |
|
... | ... |
@@ -486,7 +491,7 @@ test_s3cmd("Get multiple files", ['get', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '% |
486 | 486 |
## ====== put/get non-ASCII filenames |
487 | 487 |
test_s3cmd("Put unicode filenames", ['put', u'testsuite/encodings/UTF-8/ŪņЇЌœđЗ/Žůžo', u'%s/xyz/encodings/UTF-8/ŪņЇЌœđЗ/Žůžo' % pbucket(1)], |
488 | 488 |
retcode = 0, |
489 |
- must_find = [ 'stored as' ]) |
|
489 |
+ must_find = [ '->' ]) |
|
490 | 490 |
|
491 | 491 |
|
492 | 492 |
## ====== Make dst dir for get |
... | ... |
@@ -496,12 +501,13 @@ test_mkdir("Make dst dir for get", "testsuite-out") |
496 | 496 |
## ====== put/get non-ASCII filenames |
497 | 497 |
test_s3cmd("Get unicode filenames", ['get', u'%s/xyz/encodings/UTF-8/ŪņЇЌœđЗ/Žůžo' % pbucket(1), 'testsuite-out'], |
498 | 498 |
retcode = 0, |
499 |
- must_find = [ 'saved as' ]) |
|
499 |
+ must_find = [ '->' ]) |
|
500 | 500 |
|
501 | 501 |
|
502 | 502 |
## ====== Get multiple files |
503 | 503 |
test_s3cmd("Get multiple files", ['get', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '%s/xyz/etc/AtomicClockRadio.ttf' % pbucket(1), 'testsuite-out'], |
504 |
- must_find = [ u"saved as 'testsuite-out/Logo.PNG'", u"saved as 'testsuite-out/AtomicClockRadio.ttf'" ]) |
|
504 |
+ must_find = [ u"-> testsuite-out/Logo.PNG", |
|
505 |
+ u"-> testsuite-out/AtomicClockRadio.ttf" ]) |
|
505 | 506 |
|
506 | 507 |
## ====== Upload files differing in capitalisation |
507 | 508 |
test_s3cmd("blah.txt / Blah.txt", ['put', '-r', 'testsuite/blahBlah', pbucket(1)], |
... | ... |
@@ -576,7 +582,7 @@ test_s3cmd("Don't put symbolic links", ['put', 'testsuite/etc/linked1.png', 's3: |
576 | 576 |
|
577 | 577 |
## ====== Put symbolic link |
578 | 578 |
test_s3cmd("Put symbolic links", ['put', 'testsuite/etc/linked1.png', 's3://%s/xyz/' % bucket(1),'--follow-symlinks' ], |
579 |
- must_find = [ "File 'testsuite/etc/linked1.png' stored as '%s/xyz/linked1.png'" % pbucket(1)]) |
|
579 |
+ must_find = [ "testsuite/etc/linked1.png -> %s/xyz/linked1.png" % pbucket(1)]) |
|
580 | 580 |
|
581 | 581 |
## ====== Sync symbolic links |
582 | 582 |
test_s3cmd("Sync symbolic links", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--follow-symlinks' ], |
... | ... |
@@ -584,7 +590,7 @@ test_s3cmd("Sync symbolic links", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket |
584 | 584 |
# Don't want to recursively copy linked directories! |
585 | 585 |
must_not_find_re = ["etc/more/linked-dir/more/give-me-more.txt", |
586 | 586 |
"etc/brokenlink.png"], |
587 |
- ) |
|
587 |
+ retcode = EX_PARTIAL) |
|
588 | 588 |
|
589 | 589 |
## ====== Multi source move |
590 | 590 |
test_s3cmd("Multi-source move", ['mv', '-r', '%s/copy/blahBlah/Blah.txt' % pbucket(2), '%s/copy/etc/' % pbucket(2), '%s/moved/' % pbucket(2)], |