From Fedora Project Wiki

(initial writeup)
 
(improve instructions)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=Test swap-on-zram and hibernation (suspend-to-disk).
|description=Test swap-on-zram together with system hibernation (suspend-to-disk).
 
|setup=
# Make sure your system can hibernate (and restore) correctly '''before''' you install and configure swap-on-zram (see instructions below). If your system doesn't hibernate correctly, this test case is not applicable to you.
# After you verified your system hibernates correctly, make sure your system has swap-on-zram [[QA:Testcase SwapOnZRAM install and enable|installed and enabled]].


|actions=
|actions=
<ol>
<ol>
<li>This this test case depends on existing disk-based swap, and installation of `zram-generator` and `zram-generator-defaults` followed by a reboot. Check to ensure you have two swap devices: zram and disk.
<li>Make sure you have both a disk-based swap and a zram swap:
<pre>
<pre>$ swapon
$ swapon
NAME      TYPE      SIZE USED PRIO
NAME      TYPE      SIZE USED PRIO
/dev/sda5  partition 10.4G  0B  -2
/dev/sda5  partition 10.4G  0B  -2
Line 12: Line 15:
</pre>
</pre>
<li> Switch to root user.
<li> Switch to root user.
<pre>
<pre>sudo -i</pre>
$ sudo -i
</pre>
<li> Prepare the system to test hibernation in "reboot" mode:
<li> Prepare the system to test hibernation in "reboot" mode:
<pre>
<pre>echo reboot > /sys/power/disk</pre>
# echo reboot > /sys/power/disk
<li> When you're ready to hibernate, initiate hibernation using this command:
</pre>
<pre>echo disk > /sys/power/state</pre>
<li> When you're ready to hibernate, initiate hibernation using this command. Following the reboot you should be returned to the desktop state as it was upon issuing this command (rather than a login screen).
<li> Your system should hibernate, reboot, and you should be returned to your session '''in the exact state you left it in''', i.e. the system session should still show your terminal window (or VT) with the commands you just executed, all other apps (if in graphical desktop session) should still be running, etc. You should '''not''' be shown a login screen leading to a completely new session.
<pre>
<li> Repeat hibernation two more times, the same conditions apply.
# echo disk > /sys/power/state
</pre>
<li> Repeat a second time.
<pre>
# echo disk > /sys/power/state
</pre>
<li> Repeat a third time.
<pre>
# echo disk > /sys/power/state
</pre>
</ol>
</ol>



Revision as of 18:51, 1 July 2020

Description

Test swap-on-zram together with system hibernation (suspend-to-disk).

Setup

  1. Make sure your system can hibernate (and restore) correctly before you install and configure swap-on-zram (see instructions below). If your system doesn't hibernate correctly, this test case is not applicable to you.
  2. After you verified your system hibernates correctly, make sure your system has swap-on-zram installed and enabled.

How to test

  1. Make sure you have both a disk-based swap and a zram swap:
    $ swapon
    NAME       TYPE       SIZE USED PRIO
    /dev/sda5  partition 10.4G   0B   -2
    /dev/zram0 partition  3.8G   0B  100
    
  2. Switch to root user.
    sudo -i
  3. Prepare the system to test hibernation in "reboot" mode:
    echo reboot > /sys/power/disk
  4. When you're ready to hibernate, initiate hibernation using this command:
    echo disk > /sys/power/state
  5. Your system should hibernate, reboot, and you should be returned to your session in the exact state you left it in, i.e. the system session should still show your terminal window (or VT) with the commands you just executed, all other apps (if in graphical desktop session) should still be running, etc. You should not be shown a login screen leading to a completely new session.
  6. Repeat hibernation two more times, the same conditions apply.

Expected Results

  1. The system should reboot each time and return you to the desktop state as it was at the time the hibernation was initiated.