summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional/test_utils.py
diff options
context:
space:
mode:
authordyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 18:53:26 +0000
committerdyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 18:53:26 +0000
commit0b8eb9033aba842737010e7e281dbd0a78f15b2f (patch)
tree31174ef0cfe92146b9e394b7d976cd48e8c3becd /chrome/test/functional/test_utils.py
parentbba8669ac315e0710b9b544c93d3e4ab6734911b (diff)
downloadchromium_src-0b8eb9033aba842737010e7e281dbd0a78f15b2f.zip
chromium_src-0b8eb9033aba842737010e7e281dbd0a78f15b2f.tar.gz
chromium_src-0b8eb9033aba842737010e7e281dbd0a78f15b2f.tar.bz2
Add helper function for getting credentials key for a specified bot on the chrome-qa waterfall and chromium waterfall.
TEST=none BUG=none Review URL: http://codereview.chromium.org/7532009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional/test_utils.py')
-rw-r--r--chrome/test/functional/test_utils.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/test/functional/test_utils.py b/chrome/test/functional/test_utils.py
index d1c9bfb..45ed7a1 100644
--- a/chrome/test/functional/test_utils.py
+++ b/chrome/test/functional/test_utils.py
@@ -8,6 +8,7 @@ import copy
import email
import logging
import os
+import platform
import smtplib
import subprocess
import types
@@ -236,6 +237,7 @@ def CallFunctionWithNewTimeout(self, new_timeout, function):
function()
del timeout_changer
+
def GetOmniboxMatchesFor(self, text, windex=0, attr_dict=None):
"""Fetch omnibox matches with the given attributes for the given query.
@@ -256,6 +258,7 @@ def GetOmniboxMatchesFor(self, text, windex=0, attr_dict=None):
attr_dict=attr_dict)
return matches
+
def GetMemoryUsageOfProcess(pid):
"""Queries the system for the current memory usage of a specified process.
@@ -276,3 +279,27 @@ def GetMemoryUsageOfProcess(pid):
return float(stdout.strip()) / 1024
else:
return 0
+
+
+def GetCredsKey():
+ """Get the credential key associated with a bot on the waterfall.
+
+ The key is associated with the proper credentials in the text data file stored
+ in the private directory. The key determines a bot's OS and machine name. Each
+ key credential is associated with its own user/password value. This allows
+ sync integration tests to run in parallel on all bots.
+
+ Returns:
+ A String of the credentials key for the specified bot. Otherwise None.
+ """
+ if pyauto.PyUITest.IsWin():
+ system_name = 'win'
+ elif pyauto.PyUITest.IsLinux():
+ system_name = 'linux'
+ elif pyauto.PyUITest.IsMac():
+ system_name = 'mac'
+ else:
+ return None
+ node = platform.uname()[1].split('.')[0]
+ creds_key = 'test_google_acct_%s_%s' % (system_name, node)
+ return creds_key