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

Side by Side Diff: server/site_linux_router.py

Issue 3334002: Retry delbr on linux_router deconfig (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: Created 10 years, 3 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_WiFiSecMat/001StaticKeyWEP104 » ('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 logging, re 5 import logging, re, time
6 from autotest_lib.client.common_lib import error 6 from autotest_lib.client.common_lib import error
7 from autotest_lib.server import site_eap_tls 7 from autotest_lib.server import site_eap_tls
8 8
9 def isLinuxRouter(router): 9 def isLinuxRouter(router):
10 router_uname = router.run('uname').stdout 10 router_uname = router.run('uname').stdout
11 return re.search('Linux', router_uname) 11 return re.search('Linux', router_uname)
12 12
13 class LinuxRouter(object): 13 class LinuxRouter(object):
14 """ 14 """
15 Linux/mac80211-style WiFi Router support for WiFiTest class. 15 Linux/mac80211-style WiFi Router support for WiFiTest class.
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if not self.hostapd['configured']: 307 if not self.hostapd['configured']:
308 return 308 return
309 309
310 # Taking down hostapd takes wlan0 and mon.wlan0 down. 310 # Taking down hostapd takes wlan0 and mon.wlan0 down.
311 self.router.run("pkill hostapd >/dev/null 2>&1", ignore_status=True) 311 self.router.run("pkill hostapd >/dev/null 2>&1", ignore_status=True)
312 # self.router.run("rm -f %s" % self.hostapd['file']) 312 # self.router.run("rm -f %s" % self.hostapd['file'])
313 313
314 # Tear down the bridge. 314 # Tear down the bridge.
315 self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif), 315 self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif),
316 ignore_status=True) 316 ignore_status=True)
317 self.router.run("%s delbr %s" % (self.cmd_brctl, self.bridgeif), 317
318 ignore_status=True) 318 # Try a couple times to remove the bridge; hostapd may still be exiting
319 for attempt in range(3):
320 result = self.router.run("%s delbr %s" %
321 (self.cmd_brctl, self.bridgeif),
322 ignore_status=True)
323 if not result.stderr:
324 break
325 time.sleep(1)
326 else:
327 raise error.TestFail("Unable to delete bridge %s: %s" %
328 (self.bridgeif, result.stderr))
Sam Leffler 2010/09/01 21:15:07 would it be better to wait on the hostapd pid and/
Paul Stewart 2010/09/01 23:00:47 The "trap" technique just kicks the can down the r
329
319 330
320 self.hostapd['configured'] = False 331 self.hostapd['configured'] = False
321 332
322 333
323 def get_ssid(self): 334 def get_ssid(self):
324 return self.hostapd['conf']['ssid'] 335 return self.hostapd['conf']['ssid']
OLDNEW
« no previous file with comments | « no previous file | server/site_tests/network_WiFiSecMat/001StaticKeyWEP104 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698