| OLD | NEW |
| 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 common, fnmatch, logging, os, re, string, threading, time | 5 import common, fnmatch, logging, os, re, string, threading, time |
| 6 | 6 |
| 7 from autotest_lib.server import autotest, hosts, subcommand | 7 from autotest_lib.server import autotest, hosts, subcommand |
| 8 from autotest_lib.server import site_bsd_router | 8 from autotest_lib.server import site_bsd_router |
| 9 from autotest_lib.server import site_linux_router | 9 from autotest_lib.server import site_linux_router |
| 10 from autotest_lib.server import site_host_attributes | 10 from autotest_lib.server import site_host_attributes |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 result = self.client.run('python "%s" "%s" "%d"' % | 258 result = self.client.run('python "%s" "%s" "%d"' % |
| 259 (script_client_file, | 259 (script_client_file, |
| 260 params.get('ssid', self.defssid), | 260 params.get('ssid', self.defssid), |
| 261 params.get('wait_timeout', self.deftimeout))).stdout.rstrip() | 261 params.get('wait_timeout', self.deftimeout))).stdout.rstrip() |
| 262 | 262 |
| 263 print "%s: %s" % (self.name, result) | 263 print "%s: %s" % (self.name, result) |
| 264 | 264 |
| 265 | 265 |
| 266 def client_powersave_on(self, params): | 266 def client_powersave_on(self, params): |
| 267 """ Enable power save operation """ | 267 """ Enable power save operation """ |
| 268 self.client.run("iwconfig %s power on" % self.client_wlanif) | 268 self.client.run("iw dev %s set power_save on" % self.client_wlanif) |
| 269 | 269 |
| 270 | 270 |
| 271 def client_powersave_off(self, params): | 271 def client_powersave_off(self, params): |
| 272 """ Disable power save operation """ | 272 """ Disable power save operation """ |
| 273 self.client.run("iwconfig %s power off" % self.client_wlanif) | 273 self.client.run("iw dev %s set power_save off" % self.client_wlanif) |
| 274 | 274 |
| 275 | 275 |
| 276 def __client_check(self, param, want): | 276 def __client_check(self, param, want): |
| 277 """ Verify negotiated station mode parameter """ | 277 """ Verify negotiated station mode parameter """ |
| 278 result = self.client.run("cat '%s/%s'" % | 278 result = self.client.run("cat '%s/%s'" % |
| 279 (self.client_debugfs_path, param)) | 279 (self.client_debugfs_path, param)) |
| 280 got = result.stdout.rstrip() # NB: chop \n | 280 got = result.stdout.rstrip() # NB: chop \n |
| 281 if got != want: | 281 if got != want: |
| 282 raise error.TestFail("client_check_%s: wanted %s got %s", | 282 raise error.TestFail("client_check_%s: wanted %s got %s", |
| 283 param, want, got) | 283 param, want, got) |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 if server_addr is None and hasattr(client_attributes, 'server_addr'): | 679 if server_addr is None and hasattr(client_attributes, 'server_addr'): |
| 680 server_addr = client_attributes.server_addr | 680 server_addr = client_attributes.server_addr |
| 681 if server_addr is not None: | 681 if server_addr is not None: |
| 682 server['addr'] = server_addr; | 682 server['addr'] = server_addr; |
| 683 # TODO(sleffler) check for wifi_addr when no control address | 683 # TODO(sleffler) check for wifi_addr when no control address |
| 684 | 684 |
| 685 # tag jobs w/ the router's address on the control network | 685 # tag jobs w/ the router's address on the control network |
| 686 config['tagname'] = router['addr'] | 686 config['tagname'] = router['addr'] |
| 687 | 687 |
| 688 return config | 688 return config |
| OLD | NEW |