power_Resume/power_SuspendType: remove check wrapper
these tests were using the deprecated QualSimple wrapper, remove the
wrapper and clean up the control files and clean up names of tests to be
consistent with autotest naming.
BUG=b:232517390
TEST=test_that $DUT power_Resume.freeze powerResume.mem
power_SuspendType.freeze power_SuspendType.mem
Change-Id: I3299fb60f183e3eb10af105eca6c01ed9c0f23cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3650970
Reviewed-by: Parker Holloway <[email protected]>
Reviewed-by: Derek Beckett <[email protected]>
Auto-Submit: Brett Brotherton <[email protected]>
Commit-Queue: Brett Brotherton <[email protected]>
Tested-by: Brett Brotherton <[email protected]>
diff --git a/client/site_tests/power_Resume/control.freeze b/client/site_tests/power_Resume/control.freeze
new file mode 100644
index 0000000..4c738f0
--- /dev/null
+++ b/client/site_tests/power_Resume/control.freeze
@@ -0,0 +1,20 @@
+# Copyright 2022 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.
+AUTHOR = 'ChromeOS Team'
+NAME = 'power_Resume.freeze'
+PURPOSE = 'Measure the time it takes to resume from suspend type freeze.'
+TIME = 'SHORT'
+TEST_TYPE = 'client'
+PY_VERSION = 3
+DOC = """
+This test will search /var/log/messages for pertinent strings to determine if
+the cpu is sleeping. It will wait for a number of seconds before suspending to
+ram. It will then calculate how many seconds the system was suspended, and
+how many seconds it took to resume. As a precaution it will ensure your
+network interface is UP after it has resumed.
+"""
+
+job.add_sysinfo_command('cbmem -c', logfile='bios_log', on_every_test=True)
+job.add_sysinfo_command('cbmem -t', logfile='bios_times', on_every_test=True)
+job.run_test('power_Resume', tag=NAME.split('.')[1], suspend_state='freeze')
diff --git a/client/site_tests/power_Resume/control.mem b/client/site_tests/power_Resume/control.mem
new file mode 100644
index 0000000..cbbcef6
--- /dev/null
+++ b/client/site_tests/power_Resume/control.mem
@@ -0,0 +1,20 @@
+# Copyright 2022 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.
+AUTHOR = 'ChromeOS Team'
+NAME = 'power_Resume.mem'
+PURPOSE = 'Measure the time it takes to resume from suspend type mem.'
+TIME = 'SHORT'
+TEST_TYPE = 'client'
+PY_VERSION = 3
+DOC = """
+This test will search /var/log/messages for pertinent strings to determine if
+the cpu is sleeping. It will wait for a number of seconds before suspending to
+ram. It will then calculate how many seconds the system was suspended, and
+how many seconds it took to resume. As a precaution it will ensure your
+network interface is UP after it has resumed.
+"""
+
+job.add_sysinfo_command('cbmem -c', logfile='bios_log', on_every_test=True)
+job.add_sysinfo_command('cbmem -t', logfile='bios_times', on_every_test=True)
+job.run_test('power_Resume', tag=NAME.split('.')[1], suspend_state='mem')
diff --git a/client/site_tests/power_Resume/control.resumewrapfreeze b/client/site_tests/power_Resume/control.resumewrapfreeze
deleted file mode 100644
index 722ad17..0000000
--- a/client/site_tests/power_Resume/control.resumewrapfreeze
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2017 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.
-
-AUTHOR = "ChromeOS Team"
-NAME = "power_ResumeWrapFreeze"
-PURPOSE = "Measure the amount of time it takes to resume from suspend."
-CRITERIA = "This test is a benchmark."
-ATTRIBUTES = ""
-TIME = "SHORT"
-TEST_CATEGORY = "Logging"
-TEST_CLASS = "power"
-TEST_TYPE = "server"
-PY_VERSION = 3
-
-DOC = """
-This test will search /var/log/messages for pertinent strings to determine if
-the cpu is sleeping. It will wait for a number of seconds before suspending to
-ram. It will then calculate how many seconds the system was suspended, and
-how many seconds it took to resume. It will also parse the ARC logcat to measure
-how many seconds it took for ARC to suspend and then resume. As a precaution it
-will ensure your network interface is UP after it has resumed.
-
-In addition to calling the UiResume test, this test will also accept the textproto
-formatted pass criteria to verify that the test passes the requisite criteria
-for the given run.
-"""
-
-from autotest_lib.server import utils
-from autotest_lib.server.cros.pvs import wrapper_job_with_name
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-TEST_NAME = "power_Resume"
-TEST_ARGS = {"suspend_state":"freeze"}
-
-def run(machine):
- # Setup the client machine.
- host = hosts.create_host(machine, servo_args=servo_args)
- wrapper_job = wrapper_job_with_name.wrapper_job_with_name(job=job,
- job_name=NAME,
- wrapper_url="power_QualTestSimple",
- args_dict=args_dict,
- default_pass_criteria={})
- wrapper_job.run(host=host, test_to_wrap=TEST_NAME, wrap_args=TEST_ARGS)
-
-parallel_simple(run, machines)
\ No newline at end of file
diff --git a/client/site_tests/power_Resume/control.resumewrapmem b/client/site_tests/power_Resume/control.resumewrapmem
deleted file mode 100644
index 0b72bc2..0000000
--- a/client/site_tests/power_Resume/control.resumewrapmem
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2017 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.
-
-AUTHOR = "ChromeOS Team"
-NAME = "power_ResumeWrapMem"
-PURPOSE = "Measure the amount of time it takes to resume from suspend."
-CRITERIA = "This test is a benchmark."
-ATTRIBUTES = ""
-TIME = "SHORT"
-TEST_CATEGORY = "Logging"
-TEST_CLASS = "power"
-TEST_TYPE = "server"
-PY_VERSION = 3
-
-DOC = """
-This test will search /var/log/messages for pertinent strings to determine if
-the cpu is sleeping. It will wait for a number of seconds before suspending to
-ram. It will then calculate how many seconds the system was suspended, and
-how many seconds it took to resume. It will also parse the ARC logcat to measure
-how many seconds it took for ARC to suspend and then resume. As a precaution it
-will ensure your network interface is UP after it has resumed.
-
-In addition to calling the UiResume test, this test will also accept the textproto
-formatted pass criteria to verify that the test passes the requisite criteria
-for the given run.
-"""
-
-from autotest_lib.server import utils
-from autotest_lib.server.cros.pvs import wrapper_job_with_name
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-TEST_NAME = "power_Resume"
-TEST_ARGS = {"suspend_state":"mem"}
-
-def run(machine):
- # Setup the client machine.
- host = hosts.create_host(machine, servo_args=servo_args)
- wrapper_job = wrapper_job_with_name.wrapper_job_with_name(job=job,
- job_name=NAME,
- wrapper_url="power_QualTestSimple",
- args_dict=args_dict,
- default_pass_criteria={})
- wrapper_job.run(host=host, test_to_wrap=TEST_NAME, wrap_args=TEST_ARGS)
-
-parallel_simple(run, machines)
\ No newline at end of file
diff --git a/client/site_tests/power_SuspendType/control.freeze b/client/site_tests/power_SuspendType/control.freeze
index 047a2b1..2ba8449 100644
--- a/client/site_tests/power_SuspendType/control.freeze
+++ b/client/site_tests/power_SuspendType/control.freeze
@@ -1,34 +1,16 @@
# Copyright 2022 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.
-AUTHOR = "bbrotherton,chromeos-pvs-dev"
-NAME = "power_SuspendTypeCheckFreeze"
-PURPOSE = "This test is used to verify the client can suspend to freeze"
-ATTRIBUTES = ""
-TIME = "FAST"
-TEST_TYPE = "server"
+AUTHOR = 'bbrotherton,chromeos-pvs-dev'
+NAME = 'power_SuspendType.freeze'
+PURPOSE = 'This test is used to verify the client supports type freeze'
+ATTRIBUTES = ''
+TIME = 'FAST'
+TEST_TYPE = 'client'
PY_VERSION = 3
DOC = """
-Call this test to report if the DUT supports suspend to Freeze state
+Call this test to report if the DUT supports suspend type freeze, if so it
+will return a PASS result, if not it will return a FAIL result.
"""
-from autotest_lib.server import utils
-from autotest_lib.server.cros.pvs import wrapper_job_with_name
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-TEST_NAME = "power_SuspendType"
-TEST_ARGS = {"desired_suspend_type":"freeze"}
-
-def run(machine):
- # Setup the client machine.
- host = hosts.create_host(machine, servo_args=servo_args)
- wrapper_job = wrapper_job_with_name.wrapper_job_with_name(job=job,
- job_name=NAME,
- wrapper_url="power_QualTestSimple",
- args_dict=args_dict,
- default_pass_criteria={})
- wrapper_job.run(host=host, test_to_wrap=TEST_NAME, wrap_args=TEST_ARGS)
-
-parallel_simple(run, machines)
+job.run_test('power_SuspendType', tag=NAME.split('.')[1], desired_suspend_type='freeze')
diff --git a/client/site_tests/power_SuspendType/control.mem b/client/site_tests/power_SuspendType/control.mem
index 7f2b897..12631fe 100644
--- a/client/site_tests/power_SuspendType/control.mem
+++ b/client/site_tests/power_SuspendType/control.mem
@@ -1,34 +1,16 @@
# Copyright 2022 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.
-AUTHOR = "bbrotherton,chromeos-pvs-dev"
-NAME = "power_SuspendTypeCheckMem"
-PURPOSE = "This test is used to verify the client can suspend to memory"
-ATTRIBUTES = ""
-TIME = "FAST"
-TEST_TYPE = "server"
+AUTHOR = 'bbrotherton,chromeos-pvs-dev'
+NAME = 'power_SuspendType.mem'
+PURPOSE = 'This test is used to verify the client supports type mem'
+ATTRIBUTES = ''
+TIME = 'FAST'
+TEST_TYPE = 'client'
PY_VERSION = 3
DOC = """
-Call this test to report if the DUT supports suspend to memory state
+Call this test to report if the DUT supports suspend type mem, if so it
+will return a PASS result, if not it will return a FAIL result.
"""
-from autotest_lib.server import utils
-from autotest_lib.server.cros.pvs import wrapper_job_with_name
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-TEST_NAME = "power_SuspendType"
-TEST_ARGS = {"desired_suspend_type":"mem"}
-
-def run(machine):
- # Setup the client machine.
- host = hosts.create_host(machine, servo_args=servo_args)
- wrapper_job = wrapper_job_with_name.wrapper_job_with_name(job=job,
- job_name=NAME,
- wrapper_url="power_QualTestSimple",
- args_dict=args_dict,
- default_pass_criteria={})
- wrapper_job.run(host=host, test_to_wrap=TEST_NAME, wrap_args=TEST_ARGS)
-
-parallel_simple(run, machines)
\ No newline at end of file
+job.run_test('power_SuspendType', tag=NAME.split('.')[1], desired_suspend_type='mem')
\ No newline at end of file
diff --git a/client/site_tests/power_SuspendType/power_SuspendType.py b/client/site_tests/power_SuspendType/power_SuspendType.py
index c6d4b4c..6935050 100644
--- a/client/site_tests/power_SuspendType/power_SuspendType.py
+++ b/client/site_tests/power_SuspendType/power_SuspendType.py
@@ -22,12 +22,11 @@
if desired_suspend_type is None:
if suspend_state != 'mem' and suspend_state != 'freeze':
- raise error.TestError(
+ raise error.TestFail(
'Did not find valid suspend state, want: freeze or mem, got: '
+ suspend_state)
else:
if suspend_state != desired_suspend_type:
- raise error.TestError(
- 'Did not find desired suspend state, want: ' +
- desired_suspend_type + ', got: ' + suspend_state)
+ raise error.TestFail('System does not support suspend type ' +
+ desired_suspend_type)
return