Skip to content

Commit

Permalink
* run-tests.py, testsuite/crappy-file-name.tar.gz:
Browse files Browse the repository at this point in the history
	  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
  • Loading branch information
ludvigm committed Jul 8, 2010
1 parent 618918c commit cef3a04
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2010-07-08 Michal Ludvig <mludvig@logix.net.nz>

* 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).

2010-07-08 Michal Ludvig <mludvig@logix.net.nz>

* S3/Utils.py, S3/S3Uri.py: Fixed names after moving
Expand Down
17 changes: 11 additions & 6 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
else:
print encoding + " specific files not found."

if not os.path.isdir('testsuite/crappy-file-name'):
os.system("tar xvz -C testsuite -f testsuite/crappy-file-name.tar.gz")
# TODO: also unpack if the tarball is newer than the directory timestamp
# for instance when a new version was pulled from SVN.

def test(label, cmd_args = [], retcode = 0, must_find = [], must_not_find = [], must_find_re = [], must_not_find_re = []):
def command_output():
print "----"
Expand Down Expand Up @@ -223,8 +228,8 @@ def test_flushdir(label, dir_name):

## ====== Sync to S3
test_s3cmd("Sync to S3", ['sync', 'testsuite/', 's3://s3cmd-autotest-1/xyz/', '--exclude', '.svn/*', '--exclude', '*.png', '--no-encrypt', '--exclude-from', 'testsuite/exclude.encodings' ],
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",
"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'" ],
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",
"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'" ],
must_not_find_re = [ "\.svn/", "\.png$" ])

if have_encoding:
Expand Down Expand Up @@ -305,7 +310,7 @@ def test_flushdir(label, dir_name):

## ====== Sync more to S3
test_s3cmd("Sync more to S3", ['sync', 'testsuite/', 's3://s3cmd-autotest-1/xyz/', '--no-encrypt' ],
must_find = [ "File 'testsuite/.svn/format' stored as 's3://s3cmd-autotest-1/xyz/.svn/format' " ])
must_find = [ "File 'testsuite/.svn/entries' stored as 's3://s3cmd-autotest-1/xyz/.svn/entries' " ])


## ====== Rename within S3
Expand All @@ -324,7 +329,7 @@ def test_flushdir(label, dir_name):
test_s3cmd("Sync more from S3", ['sync', '--delete-removed', 's3://s3cmd-autotest-1/xyz', 'testsuite-out'],
must_find = [ "deleted: testsuite-out/logo.png",
"File 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG' stored as 'testsuite-out/xyz/etc2/Logo.PNG' (22059 bytes",
"File 's3://s3cmd-autotest-1/xyz/.svn/format' stored as 'testsuite-out/xyz/.svn/format' " ],
"File 's3://s3cmd-autotest-1/xyz/.svn/entries' stored as 'testsuite-out/xyz/.svn/entries' " ],
must_not_find_re = [ "not-deleted.*etc/logo.png" ])


Expand Down Expand Up @@ -355,7 +360,7 @@ def test_flushdir(label, dir_name):
must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG copied to s3://s3cmd-Autotest-3/xyz/etc2/logo.png" ])

## ====== Recursive copy
test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', 's3://s3cmd-autotest-1/xyz/', 's3://s3cmd-autotest-2/copy', '--exclude', '.svn/*'],
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*'],
must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG copied to s3://s3cmd-autotest-2/copy/etc2/Logo.PNG",
"File s3://s3cmd-autotest-1/xyz/blahBlah/Blah.txt copied to s3://s3cmd-autotest-2/copy/blahBlah/Blah.txt",
"File s3://s3cmd-autotest-1/xyz/blahBlah/blah.txt copied to s3://s3cmd-autotest-2/copy/blahBlah/blah.txt" ],
Expand Down Expand Up @@ -392,7 +397,7 @@ def test_flushdir(label, dir_name):
## ====== Recursive delete
test_s3cmd("Recursive delete", ['del', '--recursive', '--exclude', 'Atomic*', 's3://s3cmd-autotest-1/xyz/etc'],
must_find = [ "File s3://s3cmd-autotest-1/xyz/etc/TypeRa.ttf deleted" ],
must_find_re = [ "File .*\.svn/format deleted" ],
must_find_re = [ "File .*\.svn/entries deleted" ],
must_not_find = [ "AtomicClockRadio.ttf" ])

## ====== Recursive delete all
Expand Down
Binary file modified testsuite/crappy-file-name.tar.gz
Binary file not shown.

0 comments on commit cef3a04

Please sign in to comment.