| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import binascii | 6 import binascii |
| 7 import hashlib | 7 import hashlib |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 22 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 23 | 23 |
| 24 # Ensure that the testing machine has access to this server. | 24 # Ensure that the testing machine has access to this server. |
| 25 ISOLATE_SERVER = 'https://isolateserver.appspot.com/' | 25 ISOLATE_SERVER = 'https://isolateserver.appspot.com/' |
| 26 | 26 |
| 27 # The directory containing the test data files. | 27 # The directory containing the test data files. |
| 28 TEST_DATA_DIR = os.path.join(ROOT_DIR, 'tests', 'isolateserver') | 28 TEST_DATA_DIR = os.path.join(ROOT_DIR, 'tests', 'isolateserver') |
| 29 | 29 |
| 30 | 30 |
| 31 # TODO(vadimsh): This test is a bit frankensteinish now. It uses new /content-gs |
| 32 # protocol for uploads via 'isolateserver.py archive', but uses old /content |
| 33 # protocol for validity check and fetches. |
| 34 |
| 31 class IsolateServerArchiveSmokeTest(unittest.TestCase): | 35 class IsolateServerArchiveSmokeTest(unittest.TestCase): |
| 32 def setUp(self): | 36 def setUp(self): |
| 33 # The namespace must end in '-gzip' since all files are now compressed | 37 # The namespace must end in '-gzip' since all files are now compressed |
| 34 # before being uploaded. | 38 # before being uploaded. |
| 35 self.namespace = ('temporary' + str(long(time.time())).split('.', 1)[0] | 39 self.namespace = ('temporary' + str(long(time.time())).split('.', 1)[0] |
| 36 + '-gzip') | 40 + '-gzip') |
| 37 url = ISOLATE_SERVER + '/content/get_token?from_smoke_test=1' | 41 url = ISOLATE_SERVER + '/content/get_token?from_smoke_test=1' |
| 38 self.token = urllib.quote(isolateserver.url_read(url)) | 42 self.token = urllib.quote(isolateserver.url_read(url)) |
| 39 | 43 |
| 40 def _archive_given_files(self, files): | 44 def _archive_given_files(self, files): |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if filepath: | 120 if filepath: |
| 117 os.remove(filepath) | 121 os.remove(filepath) |
| 118 | 122 |
| 119 | 123 |
| 120 if __name__ == '__main__': | 124 if __name__ == '__main__': |
| 121 if len(sys.argv) > 1 and sys.argv[1].startswith('http'): | 125 if len(sys.argv) > 1 and sys.argv[1].startswith('http'): |
| 122 ISOLATE_SERVER = sys.argv.pop(1).rstrip('/') + '/' | 126 ISOLATE_SERVER = sys.argv.pop(1).rstrip('/') + '/' |
| 123 logging.basicConfig( | 127 logging.basicConfig( |
| 124 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) | 128 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) |
| 125 unittest.main() | 129 unittest.main() |
| OLD | NEW |