Browse code

run-tests: add sign, signurl tests

Matt Domsch authored on 2015/02/01 00:14:26
Showing 1 changed files
... ...
@@ -10,6 +10,7 @@
10 10
 import sys
11 11
 import os
12 12
 import re
13
+import time
13 14
 from subprocess import Popen, PIPE, STDOUT
14 15
 import locale
15 16
 import getpass
... ...
@@ -544,6 +545,10 @@ if have_wget:
544 544
     test_wget_HEAD("HEAD check Cache-Control not present", 'http://%s.%s/copy/etc2/Logo.PNG' % (bucket(2), cfg.host_base),
545 545
                    must_not_find_re = [ "Cache-Control: max-age=3600" ])
546 546
 
547
+## ====== sign
548
+test_s3cmd("sign string", ['sign', 's3cmd'], must_find_re = ["Signature:"])
549
+test_s3cmd("signurl time", ['signurl', '%s/copy/etc2/Logo.PNG' % pbucket(2), str(int(time.time()) + 60)], must_find_re = ["http://"])
550
+test_s3cmd("signurl time offset", ['signurl', '%s/copy/etc2/Logo.PNG' % pbucket(2), '+60'], must_find_re = ["http://"])
547 551
 
548 552
 ## ====== Rename within S3
549 553
 test_s3cmd("Rename within S3", ['mv', '%s/copy/etc2/Logo.PNG' % pbucket(2), '%s/copy/etc/logo.png' % pbucket(2)],