Permalink
Browse files

Fixed testsuite for --(no-)check-md5

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@460 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 2d067a6 commit 1ba1f69a6b41d7c65051237cb2d52bfae37a44ef @mludvig mludvig committed Dec 23, 2010
Showing with 18 additions and 13 deletions.
  1. +18 −13 run-tests.py
  2. BIN testsuite.tar.gz
View
@@ -38,6 +38,11 @@
print "Something went wrong while unpacking testsuite.tar.gz"
sys.exit(1)
+os.system("tar -xf testsuite/checksum.tar -C testsuite")
+if not os.path.isfile('testsuite/checksum/cksum33.txt'):
+ print "Something went wrong while unpacking testsuite/checkum.tar"
+ sys.exit(1)
+
## Fix up permissions for permission-denied tests
os.chmod("testsuite/permission-tests/permission-denied-dir", 0444)
os.chmod("testsuite/permission-tests/permission-denied.txt", 0000)
@@ -299,19 +304,6 @@ def pbucket(tail):
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)} ])
-## ====== Don't check MD5 sum on Sync
-test_copy("Change file cksum1.txt", "testsuite/checksum/cksum2.txt", "testsuite/checksum/cksum1.txt")
-test_copy("Change file cksum33.txt", "testsuite/checksum/cksum2.txt", "testsuite/checksum/cksum33.txt")
-test_s3cmd("Don't check MD5", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--no-check-md5'],
- must_find = [ "cksum33.txt" ],
- must_not_find = [ "cksum1.txt" ])
-
-
-## ====== Check MD5 sum on Sync
-test_s3cmd("Check MD5", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--check-md5'],
- must_find = [ "cksum1.txt" ])
-
-
## ====== List bucket content
test_s3cmd("List bucket content", ['ls', '%s/xyz/' % pbucket(1) ],
must_find_re = [ u"DIR %s/xyz/binary/$" % pbucket(1) , u"DIR %s/xyz/etc/$" % pbucket(1) ],
@@ -400,6 +392,19 @@ def pbucket(tail):
must_not_find = [ "File 'testsuite/etc/linked.png' stored as '%s/xyz/etc/linked.png" % pbucket(1) ])
+## ====== Don't check MD5 sum on Sync
+test_copy("Change file cksum1.txt", "testsuite/checksum/cksum2.txt", "testsuite/checksum/cksum1.txt")
+test_copy("Change file cksum33.txt", "testsuite/checksum/cksum2.txt", "testsuite/checksum/cksum33.txt")
+test_s3cmd("Don't check MD5", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--no-check-md5'],
+ must_find = [ "cksum33.txt" ],
+ must_not_find = [ "cksum1.txt" ])
+
+
+## ====== Check MD5 sum on Sync
+test_s3cmd("Check MD5", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt', '--check-md5'],
+ must_find = [ "cksum1.txt" ])
+
+
## ====== Rename within S3
test_s3cmd("Rename within S3", ['mv', '%s/xyz/etc/logo.png' % pbucket(1), '%s/xyz/etc2/Logo.PNG' % pbucket(1)],
must_find = [ 'File %s/xyz/etc/logo.png moved to %s/xyz/etc2/Logo.PNG' % (pbucket(1), pbucket(1))])
View
Binary file not shown.

0 comments on commit 1ba1f69

Please sign in to comment.