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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | server/site_tests/network_WiFiSecMat/001StaticKeyWEP104 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_linux_router.py
diff --git a/server/site_linux_router.py b/server/site_linux_router.py
index dfa1ff3c5239d9aff391cddf320577128db37cf0..fc2d26dd511e35f77b5ca00f96eba6a09bc97ead 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import logging, re
+import logging, re, time
from autotest_lib.client.common_lib import error
from autotest_lib.server import site_eap_tls
@@ -314,8 +314,19 @@ class LinuxRouter(object):
# Tear down the bridge.
self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif),
ignore_status=True)
- self.router.run("%s delbr %s" % (self.cmd_brctl, self.bridgeif),
- ignore_status=True)
+
+ # Try a couple times to remove the bridge; hostapd may still be exiting
+ for attempt in range(3):
+ result = self.router.run("%s delbr %s" %
+ (self.cmd_brctl, self.bridgeif),
+ ignore_status=True)
+ if not result.stderr:
+ break
+ time.sleep(1)
+ else:
+ raise error.TestFail("Unable to delete bridge %s: %s" %
+ (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
+
self.hostapd['configured'] = False
« 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