suspend

The suspend test evaluates sleep and hibernation capabilities. You run the test to ensure that your hardware functions correctly after resuming from different power states.

What the test covers

(Laptops ony) The suspend test covers suspend/resume from S3 sleep state (suspend to RAM) and suspend/resume from S4 hibernation (suspend to disk). The test also covers the freeze (suspend to idle - s2idle) state that allows more energy to be saved. This test is only scheduled on systems that have built-in batteries, such as laptops.

Important

The suspend to RAM and suspend to disk abilities are essential characteristics of laptops. We therefore schedule an automated suspend test at the beginning of all certification test runs on a laptop. This ensures that all hardware functions normally post-resume. The test will always run on a laptop, much like the supportable test, regardless of what tests are scheduled.

RHEL version supported
  • RHEL 8
  • RHEL 9
  • RHEL 10
What the test does

The test queries the /sys/power/state file and determines which states are supported by the hardware. If it sees "mem" in the file, it schedules the S3 sleep test. If it sees "disk" in the file, it schedules the S4 hibernation test. If it sees both, it schedules both. What follows is the procedure for a system that supports both S3 and S4 states. If your system does not support both types it will only run the tests related to the supported type.

Suspend states on RHEL 8 and RHEL 9 are written in the /sys/power/state file.

  • If S3 sleep is supported, the script uses the pm-suspend command to suspend to RAM. The tester wakes the system up after it sleeps and the scripts check the exit code of pm-suspend to verify that the system woke up correctly. Testing then continues on the test server interface.
  • If S4 hibernation is supported, the script uses the use the pm-suspend command to suspend to disk. The tester wakes the system up after it hibernates and the scripts check the exit code of pm-suspend to verify that the system woke up correctly. Testing then continues on the test server interface.
  • If S3 sleep is supported, the tester is prompted to press the key that manually invokes it (a Fn+F-key combination or dedicated Sleep key) if such a key is present. The tester wakes the system up after it sleeps and the scripts check the exit code of pm-suspend to verify that the system woke up correctly. Testing then continues on the test server interface. If the system has no suspend key, this section can be skipped.
  • If S4 hibernation is supported, the tester is prompted to press the key that manually invokes it (a Fn+F-key combination or dedicated Hibernate key) if such a key is present. The tester wakes the system up after it hibernates and the scripts check the exit code of pm-suspend to verify that the system woke up correctly. Testing then continues on the test server interface. If the system has no suspend key, this section can be skipped.
Preparing for the test
Ensure that a swap file large enough to hold the contents of RAM was created when the system was installed. Someone must be present at the Host Under Test in order to wake it up from suspend and hibernate.
Executing the test

The suspend test is interactive. Run the following command and then select the appropriate suspend test name from the list that displays.

 rhcert-run

The test will prompt suspend? Answer Yes to suspend the laptop.

The test server will display waiting for response after it sends the suspend command. Check the laptop and confirm that it has completed suspending, then press the power button or any other key that will wake it from suspend. The test server will continuously monitor the host under test to see if it has awakened. Once it has woken up, the test server GUI will display the question Has resume completed?. Press the Yes or No button to tell the test server what happened.

The server will then continue to the hibernate test. Again, click the Yes button under the suspend? question to put the laptop into hibernate mode.

The test server will display waiting for response after it sends the hibernate command. Check the laptop and confirm that it has completed hibernating, then press the power button or any other key that will wake it from hibernation. The test server will continuously monitor the Host Under Test to see if it has awakened. Once it has woken up, the test server GUI will display the question has resume completed?. Press the Yes or No button to tell the test server what happened.

Next the test server will ask you if the system has a keyboard key that will cause the Host Under Test to suspend. If it does, click the Yes button under the question Does this system have a function key (Fn) to suspend the system to mem?. Follow the procedure described above to verify suspend and wake the system up to continue with testing.

Finally the test server will ask you if the system has a keyboard key that will cause the Host Under Test to hibernate. If it does, click the Yes button under the question Does this system have a function key (Fn) to suspend the system to disk? Follow the procedure described above to verify hibernation and wake the system up to continue with any additional tests you have scheduled.

Run time
The suspend test takes about 6 minutes on a 2012-era laptop with 4GB of RAM and a non-SSD hard drive. This is the time for a full series of tests, including both pm-suspend-based and function-key-based suspend and hibernate runs. The time will vary depending on the speed at which the laptop can write to disk, the amount and speed of the RAM installed, and the capability of the laptop to enter suspend and hibernate states through function keys. The required supportable test will add about a minute to the overall run time.