From Fedora Project Wiki

(improve instructions)
Line 1: Line 1:
 
{{QA/Test_Case
 
{{QA/Test_Case
|description=Test disable swap-on-zram permanently.
+
|description=Test disabling swap-on-zram permanently.
 +
 
 +
|setup=
 +
# A system with swap-on-zram [[QA:Testcase SwapOnZRAM install and enable|installed and enabled]].
  
 
|actions=
 
|actions=
 
<ol>
 
<ol>
<li> swap-on-zram should be enabled and running to start this test.
+
<li> Remove the swap-on-zram default configuration:
<li> Permanently disable swap-on-zram.
+
<pre>sudo dnf remove zram-generator-defaults</pre>
<pre> sudo touch /etc/systemd/zram-generator.conf</pre> `or` <pre>sudo dnf remove zram-generator-defaults</pre>
+
'''Alternatively''', you can override the default config file with an empty one:
And now <b>reboot</b>.
+
<pre>sudo touch /etc/systemd/zram-generator.conf</pre>
<li> Confirm it's stopped:
+
<li> Reboot.
 +
<li> Confirm that swap-on-zram is not active. `zramctl` should not list the `/dev/zram0` device:
 
<pre>$ zramctl
 
<pre>$ zramctl
$ swapon
+
</pre>
 +
`swapon` should not list this device either, only disk swap partitions:
 +
<pre>$ 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
$ sudo systemctl status swap-create@zram0
+
</pre>
 
+
The service should be marked as `inactive (dead)`:
 +
<pre>$ sudo systemctl status swap-create@zram0.service
 
● swap-create@zram0.service - Create swap on /dev/zram0
 
● swap-create@zram0.service - Create swap on /dev/zram0
 
     Loaded: loaded (/usr/lib/systemd/system/swap-create@.service; static; vendor preset: disabled)
 
     Loaded: loaded (/usr/lib/systemd/system/swap-create@.service; static; vendor preset: disabled)
Line 21: Line 28:
 
             man:zram-generator.conf(5)
 
             man:zram-generator.conf(5)
 
</pre>
 
</pre>
 +
<li> Return your system back to original state (install the removed package or remove the newly created config override).
 
</ol>
 
</ol>
  
 
|results=
 
|results=
# Status should be inactive (dead).
+
# After removing the default configuration, swap-on-zram should not be active and its device should not be visible in `zramctl` and `swapon` commands output.
# There should be no /dev/zram0 device listed for the `zramctl` and `swapon` commands.
 
 
}}
 
}}
  
 
[[Category:Test Days Test Cases]]
 
[[Category:Test Days Test Cases]]

Revision as of 15:11, 1 July 2020

Description

Test disabling swap-on-zram permanently.

Setup

  1. A system with swap-on-zram installed and enabled.

How to test

  1. Remove the swap-on-zram default configuration:
    sudo dnf remove zram-generator-defaults

    Alternatively, you can override the default config file with an empty one:

    sudo touch /etc/systemd/zram-generator.conf
  2. Reboot.
  3. Confirm that swap-on-zram is not active. zramctl should not list the /dev/zram0 device:
    $ zramctl
    

    swapon should not list this device either, only disk swap partitions:

    $ swapon
    NAME      TYPE       SIZE USED PRIO
    /dev/sda5 partition 10.4G   0B   -2
    

    The service should be marked as inactive (dead):

    $ sudo systemctl status swap-create@zram0.service
    ● swap-create@zram0.service - Create swap on /dev/zram0
         Loaded: loaded (/usr/lib/systemd/system/swap-create@.service; static; vendor preset: disabled)
         Active: inactive (dead)
           Docs: man:zram-generator(8)
                 man:zram-generator.conf(5)
    
  4. Return your system back to original state (install the removed package or remove the newly created config override).

Expected Results

  1. After removing the default configuration, swap-on-zram should not be active and its device should not be visible in zramctl and swapon commands output.