Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: tests/isolateserver_smoke_test.py

Issue 25093003: Client side implementation of new /content-gs isolate protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « isolateserver.py ('k') | tests/isolateserver_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « isolateserver.py ('k') | tests/isolateserver_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698