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

Side by Side Diff: server/site_linux_router.py

Issue 1696006: Integrate with autotest log. (Closed)
Patch Set: Iterate Created 10 years, 8 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
« no previous file with comments | « no previous file | server/site_tests/network_WiFiMatFunc/control » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 6
7 def isLinuxRouter(router): 7 def isLinuxRouter(router):
8 router_uname = router.run('uname').stdout 8 router_uname = router.run('uname').stdout
9 return re.search('Linux', router_uname) 9 return re.search('Linux', router_uname)
10 10
(...skipping 27 matching lines...) Expand all
38 # Default to 1st available wireless phy. 38 # Default to 1st available wireless phy.
39 if "phydev" not in params: 39 if "phydev" not in params:
40 output = self.router.run("%s list" % self.cmd_iw).stdout 40 output = self.router.run("%s list" % self.cmd_iw).stdout
41 test = re.compile("Wiphy (.*)") 41 test = re.compile("Wiphy (.*)")
42 for line in output.splitlines(): 42 for line in output.splitlines():
43 m = test.match(line) 43 m = test.match(line)
44 if m: 44 if m:
45 self.phydev = m.group(1) 45 self.phydev = m.group(1)
46 break 46 break
47 else: 47 else:
48 raise Exception("No Wireless NIC detected on the device") 48 raise error.TestFail("No Wireless NIC detected on the device")
49 else: 49 else:
50 self.phydev = params['phydev'] 50 self.phydev = params['phydev']
51 51
52 52
53 # hostapd configuration persists throughout the test, subsequent 53 # hostapd configuration persists throughout the test, subsequent
54 # 'config' commands only modify it. 54 # 'config' commands only modify it.
55 self.hostapd = { 55 self.hostapd = {
56 'configured': False, 56 'configured': False,
57 'file': "/tmp/%s.conf" % self.phydev, 57 'file': "/tmp/%s.conf" % self.phydev,
58 'driver': "nl80211", 58 'driver': "nl80211",
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 """ Configure the AP per test requirements """ 124 """ Configure the AP per test requirements """
125 125
126 if self.hostapd['configured']: 126 if self.hostapd['configured']:
127 self.deconfig({}) 127 self.deconfig({})
128 128
129 if self.apmode: 129 if self.apmode:
130 # Construct the hostapd.conf file and start hostapd. 130 # Construct the hostapd.conf file and start hostapd.
131 conf = self.hostapd['conf'] 131 conf = self.hostapd['conf']
132 htcaps = set() 132 htcaps = set()
133 133
134 conf['driver'] = params.get('hostapd_driver', self.hostapd['driver'] ) 134 conf['driver'] = params.get('hostapd_driver',
135 self.hostapd['driver'])
135 136
136 for k, v in params.iteritems(): 137 for k, v in params.iteritems():
137 if k == 'ssid': 138 if k == 'ssid':
138 conf['ssid'] = v 139 conf['ssid'] = v
139 elif k == 'channel': 140 elif k == 'channel':
140 freq = int(v) 141 freq = int(v)
141 142
142 # 2.4GHz 143 # 2.4GHz
143 if freq < 2500: 144 if freq < 2500:
144 if conf['hw_mode'] == 'a': 145 if conf['hw_mode'] == 'a':
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 conf['wep_default_key'] = v 201 conf['wep_default_key'] = v
201 elif k == 'ht20': 202 elif k == 'ht20':
202 conf['wmm_enabled'] = 1 203 conf['wmm_enabled'] = 1
203 elif k == 'ht40': 204 elif k == 'ht40':
204 htcaps.add('[HT40-]') 205 htcaps.add('[HT40-]')
205 htcaps.add('[HT40+]') 206 htcaps.add('[HT40+]')
206 conf['wmm_enabled'] = 1 207 conf['wmm_enabled'] = 1
207 elif k == 'shortgi': 208 elif k == 'shortgi':
208 htcaps.add('[SHORT-GI-20]') 209 htcaps.add('[SHORT-GI-20]')
209 htcaps.add('[SHORT-GI-40]') 210 htcaps.add('[SHORT-GI-40]')
210 elif k == 'pureg' or k == 'puren' or k == 'wepmode' or k == 'rif s': 211 elif k == 'pureg' or k == 'puren' or k == 'wepmode' \
212 or k == 'rifs' or k == 'protmode':
211 # no support 213 # no support
212 pass 214 pass
213 else: 215 else:
214 conf[k] = v 216 conf[k] = v
215 217
216 # Aggregate ht_capab. 218 # Aggregate ht_capab.
217 if htcaps: 219 if htcaps:
218 conf['ieee80211n'] = 1 220 conf['ieee80211n'] = 1
219 conf['ht_capab'] = ''.join(htcaps) 221 conf['ht_capab'] = ''.join(htcaps)
220 222
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 ignore_status=True) 262 ignore_status=True)
261 263
262 self.hostapd['configured'] = False 264 self.hostapd['configured'] = False
263 265
264 def client_check_config(self, params): 266 def client_check_config(self, params):
265 """ 267 """
266 Check network configuration on client to verify parameters 268 Check network configuration on client to verify parameters
267 have been negotiated during the connection to the router. 269 have been negotiated during the connection to the router.
268 """ 270 """
269 # XXX fill in 271 # XXX fill in
OLDNEW
« no previous file with comments | « no previous file | server/site_tests/network_WiFiMatFunc/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698