From Fedora Project Wiki
(improve instructions) |
Chrismurphy (talk | contribs) (add note on enabling suspend to disk) |
||
Line 4: | Line 4: | ||
|setup= | |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. | # 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 | # After you verified your system hibernates correctly, make sure your system has swap-on-zram [[QA:Testcase SwapOnZRAM install]] installed and enabled | ||
# Note: For qemu-kvm testing, make sure suspend to disk is enabled. | |||
<pre> | |||
sudo virsh edit -nameofVM- | |||
<pm> | |||
<suspend-to-mem enabled='yes'/> | |||
<suspend-to-disk enabled='yes'/> | |||
</pre> | |||
|actions= | |actions= |
Revision as of 00:49, 6 July 2020
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 installed and enabled
- Note: For qemu-kvm testing, make sure suspend to disk is enabled.
sudo virsh edit -nameofVM- <pm> <suspend-to-mem enabled='yes'/> <suspend-to-disk enabled='yes'/>
How to test
- 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
- Switch to root user.
sudo -i
- Prepare the system to test hibernation in "reboot" mode:
echo reboot > /sys/power/disk
- When you're ready to hibernate, initiate hibernation using this command:
echo disk > /sys/power/state
- 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.
- Repeat hibernation two more times, the same conditions apply.
Expected Results
- The system should reboot each time and return you to the desktop state as it was at the time the hibernation was initiated.