From Fedora Project Wiki

(initial writeup)
 
(category)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{QA/Test_Case
 
{{QA/Test_Case
|description=Test installation `zram-generator` and `zram-generator-defaults` (default enabled)
+
|description=Test installation of `zram-generator` and `zram-generator-defaults` (enables swap-on-zram by default)
  
 
|actions=
 
|actions=
 
<ol>
 
<ol>
<li> Recommend removing the following packages. The swap-on-zram implementations in those packages have minor conflicts with `zram-generator`, but mostly they'll just contribute to user confusion.
+
<li> We recommend to remove the following packages. The swap-on-zram implementations in those packages have minor conflicts with `zram-generator`, but mostly they'll just contribute to user confusion.
 
<pre>sudo dnf remove anaconda zram</pre>
 
<pre>sudo dnf remove anaconda zram</pre>
<li> Install `zram-generator` and its defaults package:
+
<li> Install `zram-generator` and `zram-generator-defaults`:
 
<pre>sudo dnf install zram-generator zram-generator-defaults
 
<pre>sudo dnf install zram-generator zram-generator-defaults
 
</pre>
 
</pre>
 
<li> Reboot your machine
 
<li> Reboot your machine
<li> Verify that swap-on-zram is active.
+
<li> Verify that swap-on-zram is active. `zramctl` should list the `/dev/zram0` device and show it mounted as `[SWAP]`. Example:
 
<pre>$ zramctl  
 
<pre>$ zramctl  
 
NAME      ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
 
NAME      ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
 
/dev/zram0 lzo-rle      1.4G  4K  74B  12K      2 [SWAP]
 
/dev/zram0 lzo-rle      1.4G  4K  74B  12K      2 [SWAP]
 
</pre>
 
</pre>
Notice that `/dev/zram0` device is present and it's mounted as `[SWAP]`.
+
<li> Verify that the size of the device in the output above (`DISKSIZE` column) has a size equal to 50% of installed memory, or 4 GiB, whichever is smaller.
<li> Verify that `swapon` lists the zram device:
+
<li> Verify that `swapon` lists the `/dev/zram0` device. Example:
 
<pre>$ swapon  
 
<pre>$ swapon  
 
NAME      TYPE      SIZE USED PRIO
 
NAME      TYPE      SIZE USED PRIO
 
/dev/vda1  partition 500M  0B  -2
 
/dev/vda1  partition 500M  0B  -2
/dev/zram0 partition 1.4G  0B   -3
+
/dev/zram0 partition 1.4G  0B 100
 
</pre>
 
</pre>
Notice that `/dev/zram0` is present. If you have another swap device present, like in the example above, that is not a problem.
+
If you have another swap device present, like in the example above, that is not a problem. Unless you configured your swap priority manually, your pre-existing swap device should have a lower priority than the new `/dev/zram0` device.
 +
<li> Verify the service unit file is marked as "<span style="color:green">active (exited)</span>" and its output looks OK with no errors or issues listed.
 +
<pre>$ 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: active (exited) since Sun 2020-06-28 19:24:57 MDT; 36s ago
 +
      Docs: man:zram-generator(8)
 +
            man:zram-generator.conf(5)
 +
    Process: 646 ExecStart=/usr/lib/systemd/system-generators/zram-generator --setup-device zram0 (code=exited, status=0/SUCCESS)
 +
  Main PID: 646 (code=exited, status=0/SUCCESS)
 +
        CPU: 32ms
 +
 
 +
Jun 28 19:24:57 fmac.local systemd[1]: Starting Create swap on /dev/zram0...
 +
Jun 28 19:24:57 fmac.local zram-generator[648]: Setting up swapspace version 1, size = 3.8 GiB (4105170944 bytes)
 +
Jun 28 19:24:57 fmac.local zram-generator[648]: no label, UUID=03831cdf-96df-4a7a-a6c2-3bc8406f33f3
 +
Jun 28 19:24:57 fmac.local systemd[1]: Finished Create swap on /dev/zram0.
 +
</pre>
 +
 
 
</ol>
 
</ol>
  
Line 29: Line 46:
 
}}
 
}}
  
[[Category:Test Days Test Cases]]
+
[[Category:Test Days Test Cases]] [[Category:Package_rust-zram-generator_test_cases]]

Latest revision as of 07:03, 8 July 2020

Description

Test installation of zram-generator and zram-generator-defaults (enables swap-on-zram by default)


How to test

  1. We recommend to remove the following packages. The swap-on-zram implementations in those packages have minor conflicts with zram-generator, but mostly they'll just contribute to user confusion.
    sudo dnf remove anaconda zram
  2. Install zram-generator and zram-generator-defaults:
    sudo dnf install zram-generator zram-generator-defaults
    
  3. Reboot your machine
  4. Verify that swap-on-zram is active. zramctl should list the /dev/zram0 device and show it mounted as [SWAP]. Example:
    $ zramctl 
    NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
    /dev/zram0 lzo-rle       1.4G   4K   74B   12K       2 [SWAP]
    
  5. Verify that the size of the device in the output above (DISKSIZE column) has a size equal to 50% of installed memory, or 4 GiB, whichever is smaller.
  6. Verify that swapon lists the /dev/zram0 device. Example:
    $ swapon 
    NAME       TYPE      SIZE USED PRIO
    /dev/vda1  partition 500M   0B   -2
    /dev/zram0 partition 1.4G   0B  100
    

    If you have another swap device present, like in the example above, that is not a problem. Unless you configured your swap priority manually, your pre-existing swap device should have a lower priority than the new /dev/zram0 device.

  7. Verify the service unit file is marked as "active (exited)" and its output looks OK with no errors or issues listed.
    $ 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: active (exited) since Sun 2020-06-28 19:24:57 MDT; 36s ago
           Docs: man:zram-generator(8)
                 man:zram-generator.conf(5)
        Process: 646 ExecStart=/usr/lib/systemd/system-generators/zram-generator --setup-device zram0 (code=exited, status=0/SUCCESS)
       Main PID: 646 (code=exited, status=0/SUCCESS)
            CPU: 32ms
    
    Jun 28 19:24:57 fmac.local systemd[1]: Starting Create swap on /dev/zram0...
    Jun 28 19:24:57 fmac.local zram-generator[648]: Setting up swapspace version 1, size = 3.8 GiB (4105170944 bytes)
    Jun 28 19:24:57 fmac.local zram-generator[648]: no label, UUID=03831cdf-96df-4a7a-a6c2-3bc8406f33f3
    Jun 28 19:24:57 fmac.local systemd[1]: Finished Create swap on /dev/zram0.
    

Expected Results

  1. The zram-generator and zram-generator-defaults are installed without issues, and the feature is automatically activated after a reboot with the proper size. It should have a size equal to 50% of installed memory, or 4GiB, whichever is smaller.