Browse code

more curl cleanups

Matt Domsch authored on 2015/09/15 13:34:21
Showing 1 changed files
... ...
@@ -223,7 +223,7 @@ def test_copy(label, src_file, dst_file):
223 223
     return test(label, cmd)
224 224
 
225 225
 def test_curl_HEAD(label, src_file, **kwargs):
226
-    cmd = ['curl', '--head', '-i', '--no-keepalive']
226
+    cmd = ['curl', '--head', '-i']
227 227
     cmd.append(src_file)
228 228
     return test(label, cmd, **kwargs)
229 229
 
... ...
@@ -407,9 +407,8 @@ test_s3cmd("Put public, guess MIME", ['put', '--guess-mime-type', '--acl-public'
407 407
 
408 408
 ## ====== Retrieve from URL
409 409
 if have_curl:
410
-    test("Retrieve from URL", ['curl', '-o', 'testsuite-out/logo.png', 'http://%s.%s/xyz/etc/logo.png' % (bucket(1), cfg.host_base)],
411
-        must_find_re = [ 'logo.png.*saved \[22059/22059\]' ])
412
-
410
+    test("Retrieve from URL", ['curl', '--silent', '--head', '-i', 'http://%s.%s/xyz/etc/logo.png' % (bucket(1), cfg.host_base)],
411
+         must_find_re = ['Content-Length: 22059'])
413 412
 
414 413
 ## ====== Change ACL to Private
415 414
 test_s3cmd("Change ACL to Private", ['setacl', '--acl-private', '%s/xyz/etc/l*.png' % pbucket(1)],
... ...
@@ -418,9 +417,8 @@ test_s3cmd("Change ACL to Private", ['setacl', '--acl-private', '%s/xyz/etc/l*.p
418 418
 
419 419
 ## ====== Verify Private ACL
420 420
 if have_curl:
421
-    test("Verify Private ACL", ['curl', '-o', 'testsuite-out/logo.png', 'http://%s.%s/xyz/etc/logo.png' % (bucket(1), cfg.host_base)],
422
-         retcode = [1, 8],
423
-         must_find_re = [ 'ERROR 403: Forbidden' ])
421
+    test("Verify Private ACL", ['curl', '--silent', '-i', '--head', 'http://%s.%s/xyz/etc/logo.png' % (bucket(1), cfg.host_base)],
422
+         must_find_re = [ '403 Forbidden' ])
424 423
 
425 424
 
426 425
 ## ====== Change ACL to Public
... ...
@@ -430,8 +428,9 @@ test_s3cmd("Change ACL to Public", ['setacl', '--acl-public', '--recursive', '%s
430 430
 
431 431
 ## ====== Verify Public ACL
432 432
 if have_curl:
433
-    test("Verify Public ACL", ['curl', '-o', 'testsuite-out/logo.png', 'http://%s.%s/xyz/etc/logo.png' % (bucket(1), cfg.host_base)],
434
-        must_find_re = [ 'logo.png.*saved \[22059/22059\]' ])
433
+    test("Verify Public ACL", ['curl', '--silent', '-i', '--head', 'http://%s.%s/xyz/etc/logo.png' % (bucket(1), cfg.host_base)],
434
+        must_find_re = [ '200 OK',
435
+                         'Content-Length: 22059'])
435 436
 
436 437
 
437 438
 ## ====== Sync more to S3