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

Unified Diff: server/site_wifitest.py

Issue 6723006: autotest: push/pop a "test" profile for WiFi tests (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_wifitest.py
diff --git a/server/site_wifitest.py b/server/site_wifitest.py
index e05f303334b749fa3395df7f5d313fd017f42114..fded1fff2b7d6f3b4af4ee25a13089ffb60d11d8 100644
--- a/server/site_wifitest.py
+++ b/server/site_wifitest.py
@@ -152,7 +152,8 @@ class WiFiTest(object):
# potential bg thread for client network monitoring
self.client_netdump_thread = None
self.__client_discover_commands(client)
- self.profile_save({})
+ self.profile_create({'name':'test'})
+ self.profile_push({'name':'test'})
self.firewall_rules = []
# interface name on client
@@ -174,7 +175,8 @@ class WiFiTest(object):
if params.get('force_disconnect'):
self.disconnect({})
self.wifi.destroy({})
- self.profile_cleanup({})
+ self.profile_pop({'name':'test'})
+ self.profile_remove({'name':'test'})
self.client_netdump_stop({})
self.firewall_cleanup({})
@@ -1100,25 +1102,33 @@ class WiFiTest(object):
self.client.run("stop wpasupplicant; start wpasupplicant")
- def __list_profile(self):
- ret = []
- result = self.client.run('%s/test/list-entries' %
- self.client_cmd_flimflam_lib)
- for line in result.stdout.splitlines():
- m = re.search('\[(wifi_.*)\]', line)
- if m is not None:
- ret.append(m.group(1))
- return ret
- def profile_save(self, params):
- self.client_profile_list = self.__list_profile()
+ def profile_create(self, params):
+ """ Create a profile with the specified name """
+ self.client.run('%s/test/create-profile %s' %
+ (self.client_cmd_flimflam_lib, params['name']))
+
+ def profile_remove(self, params):
+ """ Remove the specified profile """
+ self.client.run('%s/test/rm-profile %s' %
+ (self.client_cmd_flimflam_lib, params['name']))
+
+ def profile_push(self, params):
+ """ Push the specified profile on the stack """
+ self.client.run('%s/test/push-profile %s' %
+ (self.client_cmd_flimflam_lib, params['name']))
+
+ def profile_pop(self, params):
+ """ Pop the specified profile from the stack or any profile
+ if no name is specified.
+ """
+ if 'name' in params:
+ self.client.run('%s/test/pop-profile %s' %
+ (self.client_cmd_flimflam_lib, params['name']))
+ else:
+ self.client.run('%s/test/pop-profile' %
+ (self.client_cmd_flimflam_lib))
- def profile_cleanup(self, params):
- exceptions = params.get('except', self.client_profile_list)
- for entry in self.__list_profile():
- if entry not in exceptions:
- self.client.run('%s/test/delete-entry %s' %
- (self.client_cmd_flimflam_lib, entry))
def __get_wifi_device_path(self):
if self.client_wifi_device_path:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698