Browse files

* s3cmd: Added --(no-)check-md5 for [sync].

	* run-tests.py, testsuite.tar.gz: Added testsuite for
	  the above.
	* NEWS: Document the above.



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@459 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 1a39ac2 commit 2d067a6dcc60608b572ea87ec9f88270ca815c00 @mludvig mludvig committed Dec 23, 2010
Showing with 32 additions and 1 deletion.
  1. +3 −0 ChangeLog
  2. +4 −0 NEWS
  3. +25 −1 run-tests.py
  4. BIN testsuite.tar.gz
View
3 ChangeLog
@@ -1,6 +1,9 @@
2010-12-24 Michal Ludvig <mludvig@logix.net.nz>
* s3cmd: Added --(no-)check-md5 for [sync].
+ * run-tests.py, testsuite.tar.gz: Added testsuite for
+ the above.
+ * NEWS: Document the above.
* s3cmd: Don't crash when file disappears before
checking MD5.
View
4 NEWS
@@ -1,3 +1,7 @@
+s3cmd 1.0.0
+===========
+* [sync] now supports --no-check-md5
+
s3cmd 1.0.0-rc2 - 2010-12-09
===============
* [sync] now supports bucket-to-bucket synchronisation
View
26 run-tests.py
@@ -189,6 +189,18 @@ def test_flushdir(label, dir_name):
test_rmdir(label + "(rm)", dir_name)
return test_mkdir(label + "(mk)", dir_name)
+def test_copy(label, src_file, dst_file):
+ if os.name == "posix":
+ cmd = ['cp', '-f']
+ elif os.name == "nt":
+ cmd = ['copy']
+ else:
+ print "Unknown platform: %s" % os.name
+ sys.exit(1)
+ cmd.append(src_file)
+ cmd.append(dst_file)
+ return test(label, cmd)
+
try:
pwd = pwd.getpwuid(os.getuid())
bucket_prefix = "%s.%s-" % (pwd.pw_name, pwd.pw_uid)
@@ -287,6 +299,19 @@ 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) ],
@@ -375,7 +400,6 @@ def pbucket(tail):
must_not_find = [ "File 'testsuite/etc/linked.png' stored as '%s/xyz/etc/linked.png" % pbucket(1) ])
-
## ====== 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
BIN testsuite.tar.gz
Binary file not shown.

0 comments on commit 2d067a6

Please sign in to comment.