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

Unified Diff: client/common_lib/sys_power.py

Issue 3412036: Basis for cryptohome+power_SuspendResume stress test. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: tweaks to test params Created 9 years, 11 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
Index: client/common_lib/sys_power.py
diff --git a/client/common_lib/sys_power.py b/client/common_lib/sys_power.py
index 3ddcfee237b217f93dfc04e85c0bd6a497f0222d..56bce4c9dbf780e531aca8544457e073bf7bfc64 100644
--- a/client/common_lib/sys_power.py
+++ b/client/common_lib/sys_power.py
@@ -1,5 +1,16 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Provides utility methods for controlling powerd in ChromiumOS.
+"""
+
import os
+from autotest_lib.client.common_lib import utils
+SUSPEND_CMD='/usr/bin/powerd_suspend'
def set_state(state):
"""
@@ -12,8 +23,8 @@ def suspend_to_ram():
"""
Suspend the system to RAM (S3)
"""
- if os.path.exists('/usr/bin/powerd_suspend'):
- os.system('/usr/bin/powerd_suspend')
+ if os.path.exists(SUSPEND_CMD):
+ utils.system(SUSPEND_CMD)
else:
set_power_state('mem')

Powered by Google App Engine
This is Rietveld 408576698