Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Provide --bucket-prefix for run-tests.py

  • Loading branch information...
commit 31fadab3a6dbf928f1e48486899001b51fe087c4 1 parent 638ed97
Aaron Maxwell redsymbol authored

Showing 1 changed file with 99 additions and 75 deletions. Show diff stats Hide diff stats

  1. +99 75 run-tests.py
174 run-tests.py
@@ -12,6 +12,14 @@
12 12 from subprocess import Popen, PIPE, STDOUT
13 13 import locale
14 14
  15 +# Set up options
  16 +# from optparse import OptionParser
  17 +# optparser = OptionParser()
  18 +# optparser.add_option("-p", "--bucket-prefix", dest="bucket_prefix", default="",
  19 +# help="Prefix for names of test buckets (to make them unique)")
  20 +# (options, args) = optparser.parse_args()
  21 +
  22 +
15 23 count_pass = 0
16 24 count_fail = 0
17 25 count_skip = 0
@@ -48,7 +56,7 @@
48 56 have_encoding = os.path.isdir('testsuite/encodings/' + encoding)
49 57
50 58 if have_encoding:
51   - enc_base_remote = "s3://s3cmd-autotest-1/xyz/%s/" % encoding
  59 + #enc_base_remote = "%s/xyz/%s/" % (pbucket(1), encoding)
52 60 enc_pattern = patterns[encoding]
53 61 else:
54 62 print encoding + " specific files not found."
@@ -170,6 +178,7 @@ def test_flushdir(label, dir_name):
170 178 test_rmdir(label + "(rm)", dir_name)
171 179 return test_mkdir(label + "(mk)", dir_name)
172 180
  181 +bucket_prefix = ''
173 182 argv = sys.argv[1:]
174 183 while argv:
175 184 arg = argv.pop(0)
@@ -183,6 +192,13 @@ def test_flushdir(label, dir_name):
183 192 if arg in ("-v", "--verbose"):
184 193 verbose = True
185 194 continue
  195 + if arg in ("-p", "--bucket-prefix"):
  196 + try:
  197 + bucket_prefix = argv.pop(0)
  198 + except IndexError:
  199 + print "Bucket prefix option must explicitly supply a bucket name prefix"
  200 + sys.exit(0)
  201 + continue
186 202 if arg.find("..") >= 0:
187 203 range_idx = arg.find("..")
188 204 range_start = arg[:range_idx] or 0
@@ -196,66 +212,74 @@ def test_flushdir(label, dir_name):
196 212 if not run_tests:
197 213 run_tests = range(0, 999)
198 214
  215 +# helper functions for generating bucket names
  216 +def bucket(tail):
  217 + '''Test bucket name'''
  218 + return '%ss3cmd-autotest-%s' % (bucket_prefix, tail)
  219 +def pbucket(tail):
  220 + '''Like bucket(), but prepends "s3://" for you'''
  221 + return 's3://' + bucket(tail)
  222 +
199 223 ## ====== Remove test buckets
200   -test_s3cmd("Remove test buckets", ['rb', '-r', 's3://s3cmd-autotest-1', 's3://s3cmd-autotest-2', 's3://s3cmd-Autotest-3'],
201   - must_find = [ "Bucket 's3://s3cmd-autotest-1/' removed",
202   - "Bucket 's3://s3cmd-autotest-2/' removed",
203   - "Bucket 's3://s3cmd-Autotest-3/' removed" ])
  224 +test_s3cmd("Remove test buckets", ['rb', '-r', pbucket(1), pbucket(2), pbucket(3)],
  225 + must_find = [ "Bucket '%s/' removed" % pbucket(1),
  226 + "Bucket '%s/' removed" % pbucket(2),
  227 + "Bucket '%s/' removed" % pbucket(3) ])
204 228
205 229
206 230 ## ====== Create one bucket (EU)
207   -test_s3cmd("Create one bucket (EU)", ['mb', '--bucket-location=EU', 's3://s3cmd-autotest-1'],
208   - must_find = "Bucket 's3://s3cmd-autotest-1/' created")
  231 +test_s3cmd("Create one bucket (EU)", ['mb', '--bucket-location=EU', pbucket(1)],
  232 + must_find = "Bucket '%s/' created" % pbucket(1))
209 233
210 234
211 235
212 236 ## ====== Create multiple buckets
213   -test_s3cmd("Create multiple buckets", ['mb', 's3://s3cmd-autotest-2', 's3://s3cmd-Autotest-3'],
214   - must_find = [ "Bucket 's3://s3cmd-autotest-2/' created", "Bucket 's3://s3cmd-Autotest-3/' created" ])
  237 +test_s3cmd("Create multiple buckets", ['mb', pbucket(2), pbucket(3)],
  238 + must_find = [ "Bucket '%s/' created" % pbucket(2), "Bucket '%s/' created" % pbucket(3)])
215 239
216 240
217 241 ## ====== Invalid bucket name
218   -test_s3cmd("Invalid bucket name", ["mb", "--bucket-location=EU", "s3://s3cmd-Autotest-EU"],
  242 +test_s3cmd("Invalid bucket name", ["mb", "--bucket-location=EU", pbucket('EU')],
219 243 retcode = 1,
220   - must_find = "ERROR: Parameter problem: Bucket name 's3cmd-Autotest-EU' contains disallowed character",
  244 + must_find = "ERROR: Parameter problem: Bucket name '%s' contains disallowed character" % bucket('EU'),
221 245 must_not_find_re = "Bucket.*created")
222 246
223 247
224 248 ## ====== Buckets list
225 249 test_s3cmd("Buckets list", ["ls"],
226   - must_find = [ "autotest-1", "autotest-2", "Autotest-3" ], must_not_find_re = "Autotest-EU")
  250 + must_find = [ "autotest-1", "autotest-2", "autotest-3" ], must_not_find_re = "autotest-EU")
227 251
228 252
229 253 ## ====== Sync to S3
230   -test_s3cmd("Sync to S3", ['sync', 'testsuite/', 's3://s3cmd-autotest-1/xyz/', '--exclude', '.svn/*', '--exclude', '*.png', '--no-encrypt', '--exclude-from', 'testsuite/exclude.encodings' ],
  254 +test_s3cmd("Sync to S3", ['sync', 'testsuite/', pbucket(1) + '/xyz/', '--exclude', '.svn/*', '--exclude', '*.png', '--no-encrypt', '--exclude-from', 'testsuite/exclude.encodings' ],
231 255 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",
232   - "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'" ],
  256 + "stored as '%s/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'" % pbucket(1) ],
233 257 must_not_find_re = [ "\.svn/", "\.png$" ])
234 258
235 259 if have_encoding:
236 260 ## ====== Sync UTF-8 / GBK / ... to S3
237   - test_s3cmd("Sync %s to S3" % encoding, ['sync', 'testsuite/encodings/' + encoding, 's3://s3cmd-autotest-1/xyz/encodings/', '--exclude', '.svn/*', '--no-encrypt' ],
238   - must_find = [ u"File 'testsuite/encodings/%(encoding)s/%(pattern)s' stored as 's3://s3cmd-autotest-1/xyz/encodings/%(encoding)s/%(pattern)s'" % { 'encoding' : encoding, 'pattern' : enc_pattern } ])
  261 + test_s3cmd("Sync %s to S3" % encoding, ['sync', 'testsuite/encodings/' + encoding, '%s/xyz/encodings/' % pbucket(1), '--exclude', '.svn/*', '--no-encrypt' ],
  262 + 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)} ])
239 263
240 264
241 265 ## ====== List bucket content
242   -must_find_re = [ u"DIR s3://s3cmd-autotest-1/xyz/binary/$", u"DIR s3://s3cmd-autotest-1/xyz/etc/$" ]
  266 +must_find_re = [ u"DIR %s/xyz/binary/$" % pbucket(1) , u"DIR %s/xyz/etc/$" % pbucket(1) ]
243 267 must_not_find = [ u"random-crap.md5", u".svn" ]
244   -test_s3cmd("List bucket content", ['ls', 's3://s3cmd-autotest-1/xyz/'],
  268 +test_s3cmd("List bucket content", ['ls', '%s/xyz/' % pbucket(1) ],
245 269 must_find_re = must_find_re,
246 270 must_not_find = must_not_find)
247 271
248 272
249 273 ## ====== List bucket recursive
250   -must_find = [ u"s3://s3cmd-autotest-1/xyz/binary/random-crap.md5" ]
  274 +must_find = [ u"%s/xyz/binary/random-crap.md5" % pbucket(1) ]
251 275 if have_encoding:
252   - must_find.append(u"s3://s3cmd-autotest-1/xyz/encodings/%(encoding)s/%(pattern)s" % { 'encoding' : encoding, 'pattern' : enc_pattern })
253   -test_s3cmd("List bucket recursive", ['ls', '--recursive', 's3://s3cmd-autotest-1'],
  276 + must_find.append(u"%(pbucket)s/xyz/encodings/%(encoding)s/%(pattern)s" % { 'encoding' : encoding, 'pattern' : enc_pattern, 'pbucket' : pbucket(1) })
  277 +test_s3cmd("List bucket recursive", ['ls', '--recursive', pbucket(1)],
254 278 must_find = must_find,
255 279 must_not_find = [ "logo.png" ])
256 280
257 281 ## ====== FIXME
258   -# test_s3cmd("Recursive put", ['put', '--recursive', 'testsuite/etc', 's3://s3cmd-autotest-1/xyz/'])
  282 +# test_s3cmd("Recursive put", ['put', '--recursive', 'testsuite/etc', '%s/xyz/' % pbucket(1) ])
259 283
260 284
261 285 ## ====== Clean up local destination dir
@@ -263,10 +287,10 @@ def test_flushdir(label, dir_name):
263 287
264 288
265 289 ## ====== Sync from S3
266   -must_find = [ "File 's3://s3cmd-autotest-1/xyz/binary/random-crap.md5' stored as 'testsuite-out/xyz/binary/random-crap.md5'" ]
  290 +must_find = [ "File '%s/xyz/binary/random-crap.md5' stored as 'testsuite-out/xyz/binary/random-crap.md5'" % pbucket(1) ]
267 291 if have_encoding:
268   - must_find.append(u"File 's3://s3cmd-autotest-1/xyz/encodings/%(encoding)s/%(pattern)s' stored as 'testsuite-out/xyz/encodings/%(encoding)s/%(pattern)s' " % { 'encoding' : encoding, 'pattern' : enc_pattern })
269   -test_s3cmd("Sync from S3", ['sync', 's3://s3cmd-autotest-1/xyz', 'testsuite-out'],
  292 + 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) })
  293 +test_s3cmd("Sync from S3", ['sync', '%s/xyz' % pbucket(1), 'testsuite-out'],
270 294 must_find = must_find)
271 295
272 296
@@ -275,61 +299,61 @@ def test_flushdir(label, dir_name):
275 299
276 300
277 301 ## ====== Put public, guess MIME
278   -test_s3cmd("Put public, guess MIME", ['put', '--guess-mime-type', '--acl-public', 'testsuite/etc/logo.png', 's3://s3cmd-autotest-1/xyz/etc/logo.png'],
279   - must_find = [ "stored as 's3://s3cmd-autotest-1/xyz/etc/logo.png'" ])
  302 +test_s3cmd("Put public, guess MIME", ['put', '--guess-mime-type', '--acl-public', 'testsuite/etc/logo.png', '%s/xyz/etc/logo.png' % pbucket(1)],
  303 + must_find = [ "stored as '%s/xyz/etc/logo.png'" % pbucket(1) ])
280 304
281 305
282 306 ## ====== Retrieve from URL
283 307 if have_wget:
284   - test("Retrieve from URL", ['wget', '-O', 'testsuite-out/logo.png', 'http://s3cmd-autotest-1.s3.amazonaws.com/xyz/etc/logo.png'],
  308 + test("Retrieve from URL", ['wget', '-O', 'testsuite-out/logo.png', 'http://%s.s3.amazonaws.com/xyz/etc/logo.png' % bucket(1)],
285 309 must_find_re = [ 'logo.png.*saved \[22059/22059\]' ])
286 310
287 311
288 312 ## ====== Change ACL to Private
289   -test_s3cmd("Change ACL to Private", ['setacl', '--acl-private', 's3://s3cmd-autotest-1/xyz/etc/l*.png'],
  313 +test_s3cmd("Change ACL to Private", ['setacl', '--acl-private', '%s/xyz/etc/l*.png' % pbucket(1)],
290 314 must_find = [ "logo.png: ACL set to Private" ])
291 315
292 316
293 317 ## ====== Verify Private ACL
294 318 if have_wget:
295   - test("Verify Private ACL", ['wget', '-O', 'testsuite-out/logo.png', 'http://s3cmd-autotest-1.s3.amazonaws.com/xyz/etc/logo.png'],
  319 + test("Verify Private ACL", ['wget', '-O', 'testsuite-out/logo.png', 'http://%s.s3.amazonaws.com/xyz/etc/logo.png' % bucket(1)],
296 320 retcode = 1,
297 321 must_find_re = [ 'ERROR 403: Forbidden' ])
298 322
299 323
300 324 ## ====== Change ACL to Public
301   -test_s3cmd("Change ACL to Public", ['setacl', '--acl-public', '--recursive', 's3://s3cmd-autotest-1/xyz/etc/', '-v'],
  325 +test_s3cmd("Change ACL to Public", ['setacl', '--acl-public', '--recursive', '%s/xyz/etc/' % pbucket(1) , '-v'],
302 326 must_find = [ "logo.png: ACL set to Public" ])
303 327
304 328
305 329 ## ====== Verify Public ACL
306 330 if have_wget:
307   - test("Verify Public ACL", ['wget', '-O', 'testsuite-out/logo.png', 'http://s3cmd-autotest-1.s3.amazonaws.com/xyz/etc/logo.png'],
  331 + test("Verify Public ACL", ['wget', '-O', 'testsuite-out/logo.png', 'http://%s.s3.amazonaws.com/xyz/etc/logo.png' % bucket(1)],
308 332 must_find_re = [ 'logo.png.*saved \[22059/22059\]' ])
309 333
310 334
311 335 ## ====== Sync more to S3
312   -test_s3cmd("Sync more to S3", ['sync', 'testsuite/', 's3://s3cmd-autotest-1/xyz/', '--no-encrypt' ],
313   - must_find = [ "File 'testsuite/.svn/entries' stored as 's3://s3cmd-autotest-1/xyz/.svn/entries' " ])
  336 +test_s3cmd("Sync more to S3", ['sync', 'testsuite/', 's3://%s/xyz/' % bucket(1), '--no-encrypt' ],
  337 + must_find = [ "File 'testsuite/.svn/entries' stored as '%s/xyz/.svn/entries' " % pbucket(1) ])
314 338
315 339
316 340 ## ====== Rename within S3
317   -test_s3cmd("Rename within S3", ['mv', 's3://s3cmd-autotest-1/xyz/etc/logo.png', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG'],
318   - must_find = [ 'File s3://s3cmd-autotest-1/xyz/etc/logo.png moved to s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG' ])
  341 +test_s3cmd("Rename within S3", ['mv', '%s/xyz/etc/logo.png' % pbucket(1), '%s/xyz/etc2/Logo.PNG' % pbucket(1)],
  342 + must_find = [ 'File %s/xyz/etc/logo.png moved to %s/xyz/etc2/Logo.PNG' % (pbucket(1), pbucket(1))])
319 343
320 344
321 345 ## ====== Rename (NoSuchKey)
322   -test_s3cmd("Rename (NoSuchKey)", ['mv', 's3://s3cmd-autotest-1/xyz/etc/logo.png', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG'],
  346 +test_s3cmd("Rename (NoSuchKey)", ['mv', '%s/xyz/etc/logo.png' % pbucket(1), '%s/xyz/etc2/Logo.PNG' % pbucket(1)],
323 347 retcode = 1,
324 348 must_find_re = [ 'ERROR:.*NoSuchKey' ],
325   - must_not_find = [ 'File s3://s3cmd-autotest-1/xyz/etc/logo.png moved to s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG' ])
  349 + must_not_find = [ 'File %s/xyz/etc/logo.png moved to %s/xyz/etc2/Logo.PNG' % (pbucket(1), pbucket(1)) ])
326 350
327 351
328 352 ## ====== Sync more from S3
329   -test_s3cmd("Sync more from S3", ['sync', '--delete-removed', 's3://s3cmd-autotest-1/xyz', 'testsuite-out'],
  353 +test_s3cmd("Sync more from S3", ['sync', '--delete-removed', '%s/xyz' % pbucket(1), 'testsuite-out'],
330 354 must_find = [ "deleted: testsuite-out/logo.png",
331   - "File 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG' stored as 'testsuite-out/xyz/etc2/Logo.PNG' (22059 bytes",
332   - "File 's3://s3cmd-autotest-1/xyz/.svn/entries' stored as 'testsuite-out/xyz/.svn/entries' " ],
  355 + "File '%s/xyz/etc2/Logo.PNG' stored as 'testsuite-out/xyz/etc2/Logo.PNG' (22059 bytes" % pbucket(1),
  356 + "File '%s/xyz/.svn/entries' stored as 'testsuite-out/xyz/.svn/entries' " % pbucket(1) ],
333 357 must_not_find_re = [ "not-deleted.*etc/logo.png" ])
334 358
335 359
@@ -338,7 +362,7 @@ def test_flushdir(label, dir_name):
338 362
339 363
340 364 ## ====== Get multiple files
341   -test_s3cmd("Get multiple files", ['get', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG', 's3://s3cmd-autotest-1/xyz/etc/AtomicClockRadio.ttf', 'testsuite-out'],
  365 +test_s3cmd("Get multiple files", ['get', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '%s/xyz/etc/AtomicClockRadio.ttf' % pbucket(1), 'testsuite-out'],
342 366 retcode = 1,
343 367 must_find = [ 'Destination must be a directory when downloading multiple sources.' ])
344 368
@@ -348,69 +372,69 @@ def test_flushdir(label, dir_name):
348 372
349 373
350 374 ## ====== Get multiple files
351   -test_s3cmd("Get multiple files", ['get', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG', 's3://s3cmd-autotest-1/xyz/etc/AtomicClockRadio.ttf', 'testsuite-out'],
  375 +test_s3cmd("Get multiple files", ['get', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '%s/xyz/etc/AtomicClockRadio.ttf' % pbucket(1), 'testsuite-out'],
352 376 must_find = [ u"saved as 'testsuite-out/Logo.PNG'", u"saved as 'testsuite-out/AtomicClockRadio.ttf'" ])
353 377
354 378 ## ====== Upload files differing in capitalisation
355   -test_s3cmd("blah.txt / Blah.txt", ['put', '-r', 'testsuite/blahBlah', 's3://s3cmd-autotest-1/'],
356   - must_find = [ 's3://s3cmd-autotest-1/blahBlah/Blah.txt', 's3://s3cmd-autotest-1/blahBlah/blah.txt' ])
  379 +test_s3cmd("blah.txt / Blah.txt", ['put', '-r', 'testsuite/blahBlah', pbucket(1)],
  380 + must_find = [ '%s/blahBlah/Blah.txt' % pbucket(1), '%s/blahBlah/blah.txt' % pbucket(1)])
357 381
358 382 ## ====== Copy between buckets
359   -test_s3cmd("Copy between buckets", ['cp', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG', 's3://s3cmd-Autotest-3/xyz/etc2/logo.png'],
360   - must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG copied to s3://s3cmd-Autotest-3/xyz/etc2/logo.png" ])
  383 +test_s3cmd("Copy between buckets", ['cp', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '%s/xyz/etc2/logo.png' % pbucket(3)],
  384 + must_find = [ "File %s/xyz/etc2/Logo.PNG copied to %s/xyz/etc2/logo.png" % (pbucket(1), pbucket(3)) ])
361 385
362 386 ## ====== Recursive copy
363   -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*'],
364   - must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG copied to s3://s3cmd-autotest-2/copy/etc2/Logo.PNG",
365   - "File s3://s3cmd-autotest-1/xyz/blahBlah/Blah.txt copied to s3://s3cmd-autotest-2/copy/blahBlah/Blah.txt",
366   - "File s3://s3cmd-autotest-1/xyz/blahBlah/blah.txt copied to s3://s3cmd-autotest-2/copy/blahBlah/blah.txt" ],
  387 +test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', '%s/xyz/' % pbucket(1), '%s/copy' % pbucket(2), '--exclude', '.svn/*', '--exclude', 'too-crappy*'],
  388 + must_find = [ "File %s/xyz/etc2/Logo.PNG copied to %s/copy/etc2/Logo.PNG" % (pbucket(1), pbucket(2)),
  389 + "File %s/xyz/blahBlah/Blah.txt copied to %s/copy/blahBlah/Blah.txt" % (pbucket(1), pbucket(2)),
  390 + "File %s/xyz/blahBlah/blah.txt copied to %s/copy/blahBlah/blah.txt" % (pbucket(1), pbucket(2)) ],
367 391 must_not_find = [ ".svn" ])
368 392
369 393 ## ====== Verify ACL and MIME type
370   -test_s3cmd("Verify ACL and MIME type", ['info', 's3://s3cmd-autotest-2/copy/etc2/Logo.PNG' ],
  394 +test_s3cmd("Verify ACL and MIME type", ['info', '%s/copy/etc2/Logo.PNG' % pbucket(2) ],
371 395 must_find_re = [ "MIME type:.*image/png",
372 396 "ACL:.*\*anon\*: READ",
373   - "URL:.*http://s3cmd-autotest-2.s3.amazonaws.com/copy/etc2/Logo.PNG" ])
  397 + "URL:.*http://%s.s3.amazonaws.com/copy/etc2/Logo.PNG" % bucket(2) ])
374 398
375 399 ## ====== Multi source move
376   -test_s3cmd("Multi-source move", ['mv', '-r', 's3://s3cmd-autotest-2/copy/blahBlah/Blah.txt', 's3://s3cmd-autotest-2/copy/etc/', 's3://s3cmd-autotest-2/moved/'],
377   - must_find = [ "File s3://s3cmd-autotest-2/copy/blahBlah/Blah.txt moved to s3://s3cmd-autotest-2/moved/Blah.txt",
378   - "File s3://s3cmd-autotest-2/copy/etc/AtomicClockRadio.ttf moved to s3://s3cmd-autotest-2/moved/AtomicClockRadio.ttf",
379   - "File s3://s3cmd-autotest-2/copy/etc/TypeRa.ttf moved to s3://s3cmd-autotest-2/moved/TypeRa.ttf" ],
  400 +test_s3cmd("Multi-source move", ['mv', '-r', '%s/copy/blahBlah/Blah.txt' % pbucket(2), '%s/copy/etc/' % pbucket(2), '%s/moved/' % pbucket(2)],
  401 + must_find = [ "File %s/copy/blahBlah/Blah.txt moved to %s/moved/Blah.txt" % (pbucket(2), pbucket(2)),
  402 + "File %s/copy/etc/AtomicClockRadio.ttf moved to %s/moved/AtomicClockRadio.ttf" % (pbucket(2), pbucket(2)),
  403 + "File %s/copy/etc/TypeRa.ttf moved to %s/moved/TypeRa.ttf" % (pbucket(2), pbucket(2)) ],
380 404 must_not_find = [ "blah.txt" ])
381 405
382 406 ## ====== Verify move
383   -test_s3cmd("Verify move", ['ls', '-r', 's3://s3cmd-autotest-2'],
384   - must_find = [ "s3://s3cmd-autotest-2/moved/Blah.txt",
385   - "s3://s3cmd-autotest-2/moved/AtomicClockRadio.ttf",
386   - "s3://s3cmd-autotest-2/moved/TypeRa.ttf",
387   - "s3://s3cmd-autotest-2/copy/blahBlah/blah.txt" ],
388   - must_not_find = [ "s3://s3cmd-autotest-2/copy/blahBlah/Blah.txt",
389   - "s3://s3cmd-autotest-2/copy/etc/AtomicClockRadio.ttf",
390   - "s3://s3cmd-autotest-2/copy/etc/TypeRa.ttf" ])
  407 +test_s3cmd("Verify move", ['ls', '-r', pbucket(2)],
  408 + must_find = [ "%s/moved/Blah.txt" % pbucket(2),
  409 + "%s/moved/AtomicClockRadio.ttf" % pbucket(2),
  410 + "%s/moved/TypeRa.ttf" % pbucket(2),
  411 + "%s/copy/blahBlah/blah.txt" % pbucket(2) ],
  412 + must_not_find = [ "%s/copy/blahBlah/Blah.txt" % pbucket(2),
  413 + "%s/copy/etc/AtomicClockRadio.ttf" % pbucket(2),
  414 + "%s/copy/etc/TypeRa.ttf" % pbucket(2) ])
391 415
392 416 ## ====== Simple delete
393   -test_s3cmd("Simple delete", ['del', 's3://s3cmd-autotest-1/xyz/etc2/Logo.PNG'],
394   - must_find = [ "File s3://s3cmd-autotest-1/xyz/etc2/Logo.PNG deleted" ])
  417 +test_s3cmd("Simple delete", ['del', '%s/xyz/etc2/Logo.PNG' % pbucket(1)],
  418 + must_find = [ "File %s/xyz/etc2/Logo.PNG deleted" % pbucket(1) ])
395 419
396 420
397 421 ## ====== Recursive delete
398   -test_s3cmd("Recursive delete", ['del', '--recursive', '--exclude', 'Atomic*', 's3://s3cmd-autotest-1/xyz/etc'],
399   - must_find = [ "File s3://s3cmd-autotest-1/xyz/etc/TypeRa.ttf deleted" ],
  422 +test_s3cmd("Recursive delete", ['del', '--recursive', '--exclude', 'Atomic*', '%s/xyz/etc' % pbucket(1)],
  423 + must_find = [ "File %s/xyz/etc/TypeRa.ttf deleted" % pbucket(1) ],
400 424 must_find_re = [ "File .*\.svn/entries deleted" ],
401 425 must_not_find = [ "AtomicClockRadio.ttf" ])
402 426
403 427 ## ====== Recursive delete all
404   -test_s3cmd("Recursive delete all", ['del', '--recursive', '--force', 's3://s3cmd-autotest-1'],
  428 +test_s3cmd("Recursive delete all", ['del', '--recursive', '--force', pbucket(1)],
405 429 must_find_re = [ "File .*binary/random-crap deleted" ])
406 430
407 431
408 432 ## ====== Remove empty bucket
409   -test_s3cmd("Remove empty bucket", ['rb', 's3://s3cmd-autotest-1'],
410   - must_find = [ "Bucket 's3://s3cmd-autotest-1/' removed" ])
  433 +test_s3cmd("Remove empty bucket", ['rb', pbucket(1)],
  434 + must_find = [ "Bucket '%s/' removed" % pbucket(1) ])
411 435
412 436
413 437 ## ====== Remove remaining buckets
414   -test_s3cmd("Remove remaining buckets", ['rb', '--recursive', 's3://s3cmd-autotest-2', 's3://s3cmd-Autotest-3'],
415   - must_find = [ "Bucket 's3://s3cmd-autotest-2/' removed",
416   - "Bucket 's3://s3cmd-Autotest-3/' removed" ])
  438 +test_s3cmd("Remove remaining buckets", ['rb', '--recursive', pbucket(2), pbucket(3)],
  439 + must_find = [ "Bucket '%s/' removed" % pbucket(2),
  440 + "Bucket '%s/' removed" % pbucket(3) ])

0 comments on commit 31fadab

Please sign in to comment.
Something went wrong with that request. Please try again.