Browse code

add multipart test

Add a multipart test, uploading a 16MB file as a series of 5MB parts.
This exercises a code path not previously tested in the test suite.

Matt Domsch authored on 2015/01/21 03:52:08
Showing 1 changed files
... ...
@@ -348,6 +348,14 @@ os.system(' '.join(cmd_args))
348 348
 test_s3cmd("Put from stdin", ['ls', '%s/single-file/single-file.txt' % pbucket(1)],
349 349
            must_find = ['%s/single-file/single-file.txt' % pbucket(1)])
350 350
 
351
+## ====== Multipart put
352
+os.system('dd if=/dev/urandom of=testsuite-out/urandom.bin bs=1M count=16')
353
+test_s3cmd("Put multipart", ['put', '--multipart-chunk-size-mb=5', 'testsuite-out/urandom.bin', '%s/urandom.bin' % pbucket(1)],
354
+           must_not_find = 'abortmp')
355
+
356
+## ====== Clean up local destination dir
357
+test_flushdir("Clean testsuite-out/", "testsuite-out")
358
+
351 359
 ## ====== Sync from S3
352 360
 must_find = [ "File '%s/xyz/binary/random-crap.md5' stored as 'testsuite-out/xyz/binary/random-crap.md5'" % pbucket(1) ]
353 361
 if have_encoding: