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

Unified Diff: appengine/third_party/python-adb/smoke_test.py

Issue 1421463006: Tweak CPU support; list all available CPU frequencies. (Closed) Base URL: git@github.com:luci/luci-py.git@5_fixes
Patch Set: Remove freqs, it's noisy in swarming stats and already available Created 5 years, 1 month 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 | « appengine/third_party/python-adb/high_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/third_party/python-adb/smoke_test.py
diff --git a/appengine/third_party/python-adb/smoke_test.py b/appengine/third_party/python-adb/smoke_test.py
index e92c239d02b64e7e0d822414f1932bf268a3a73a..dca05ffcee27622320443bda53ee36d385d2fb71 100755
--- a/appengine/third_party/python-adb/smoke_test.py
+++ b/appengine/third_party/python-adb/smoke_test.py
@@ -280,15 +280,29 @@ class Test(unittest.TestCase):
def test_cpu(self):
"""Adjust the CPU speed to power save then max speed then back to normal."""
self.high()
- expected = {u'cur', u'governor', u'max', u'min'}
+
+ # Only one of these 2 scaling governor is supported, not both for one
+ # kernel.
+ unknown = {
+ 'conservative', 'interactive'} - set(self.cmd.cache.available_governors)
+ self.assertEqual(1, len(unknown), unknown)
+ unknown = unknown.pop()
+
+ expected = {u'cur', u'governor'}
previous = self.cmd.GetCPUScale()
self.assertEqual(expected, set(previous))
try:
self.assertEqual(True, self.cmd.SetCPUScalingGovernor('powersave'))
self.assertIn(
self.cmd.GetCPUScale()['governor'], ('powersave', 'userspace'))
- self.assertEqual(True, self.cmd.SetCPUSpeed(previous['max']))
+
+ self.assertEqual(
+ True, self.cmd.SetCPUSpeed(self.cmd.cache.available_frequencies[0]))
self.assertEqual('userspace', self.cmd.GetCPUScale()['governor'])
+ with self.assertRaises(AssertionError):
+ self.cmd.SetCPUSpeed(self.cmd.cache.available_frequencies[0]-1)
+
+ self.assertEqual(False, self.cmd.SetCPUScalingGovernor(unknown))
self.assertEqual(True, self.cmd.SetCPUScalingGovernor('ondemand'))
finally:
self.assertEqual(
« no previous file with comments | « appengine/third_party/python-adb/high_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698