OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """GoogleAuthServer unittest.""" | 7 """GoogleAuthServer unittest.""" |
8 | 8 |
9 import logging, os, sys, threading, time, unittest, urllib | 9 import logging, os, sys, threading, time, unittest, urllib |
10 from autotest_lib.client.bin import chromeos_constants | |
11 from autotest_lib.client.common_lib import site_auth_server | 10 from autotest_lib.client.common_lib import site_auth_server |
| 11 from autotest_lib.client.cros import constants as chromeos_constants |
12 from site_auth_server import GoogleAuthServer | 12 from site_auth_server import GoogleAuthServer |
13 | 13 |
14 class test_auth_server(unittest.TestCase): | 14 class test_auth_server(unittest.TestCase): |
15 def setUp(self): | 15 def setUp(self): |
16 print "starting" | 16 print "starting" |
17 self._ssl_port=50030 | 17 self._ssl_port=50030 |
18 creds_path = (os.path.dirname(os.path.realpath( __file__)) + | 18 creds_path = (os.path.dirname(os.path.realpath( __file__)) + |
19 '/site_httpd_unittest_server') | 19 '/site_httpd_unittest_server') |
20 | 20 |
21 self._test_server = GoogleAuthServer(port=self._ssl_port, | 21 self._test_server = GoogleAuthServer(port=self._ssl_port, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ta_format = ('https://localhost:%s%s?auth=%s&' + | 61 ta_format = ('https://localhost:%s%s?auth=%s&' + |
62 'continue=https://localhost:%s/webhp') | 62 'continue=https://localhost:%s/webhp') |
63 ta_resp = urllib.urlopen( | 63 ta_resp = urllib.urlopen( |
64 ta_format % (self._ssl_port, | 64 ta_format % (self._ssl_port, |
65 chromeos_constants.TOKEN_AUTH_URL, | 65 chromeos_constants.TOKEN_AUTH_URL, |
66 args, | 66 args, |
67 self._ssl_port)).read() | 67 self._ssl_port)).read() |
68 except IOError, e: | 68 except IOError, e: |
69 pass | 69 pass |
70 self._test_server.wait_for_test_over() | 70 self._test_server.wait_for_test_over() |
OLD | NEW |