From Fedora Project Wiki
Chrismurphy (talk | contribs) (initial writeup) |
(improve instructions) |
||
Line 1: | Line 1: | ||
{{QA/Test_Case | {{QA/Test_Case | ||
|description=Test | |description=Test stopping the swap-on-zram service temporarily. | ||
|setup= | |||
# A system with swap-on-zram [[QA:Testcase SwapOnZRAM install and enable|installed and enabled]]. | |||
|actions= | |actions= | ||
<ol> | <ol> | ||
<li> swap-on-zram | <li> Stop the swap-on-zram service: | ||
<pre>sudo systemctl stop swap-create@zram0.service</pre> | |||
<pre>sudo systemctl stop swap-create@zram0</pre> | <li> Confirm it's stopped. The service should be marked as "`inactive (dead)`": | ||
<li> Confirm it's stopped: | <pre>$ sudo systemctl status swap-create@zram0.service | ||
<pre> sudo systemctl status swap-create@zram0 | |||
● 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 26: | Line 28: | ||
Jun 28 19:32:07 fmac.local systemd[1]: swap-create@zram0.service: Succeeded. | Jun 28 19:32:07 fmac.local systemd[1]: swap-create@zram0.service: Succeeded. | ||
Jun 28 19:32:07 fmac.local systemd[1]: Stopped Create swap on /dev/zram0. | Jun 28 19:32:07 fmac.local systemd[1]: Stopped Create swap on /dev/zram0. | ||
</pre> | |||
`zramctl` should list no device: | |||
<pre>$ zramctl | |||
</pre> | |||
`swapon` should only list your disk swap partitions and no `/dev/zram0` device: | |||
<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 | ||
</pre> | </pre> | ||
<li> | <li> Start the swap-on-zram service again and confirm it's running: | ||
<pre> sudo systemctl start swap-create@zram0 | <pre>$ sudo systemctl start swap-create@zram0.service | ||
$ sudo systemctl status swap-create@zram0 | |||
● 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 47: | Line 53: | ||
Jun 28 19:32:54 fmac.local zram-generator[1582]: no label, UUID=f046c6d8-3f69-4f21-81ae-a7b1555891d9 | Jun 28 19:32:54 fmac.local zram-generator[1582]: no label, UUID=f046c6d8-3f69-4f21-81ae-a7b1555891d9 | ||
Jun 28 19:32:54 fmac.local systemd[1]: Finished Create swap on /dev/zram0. | Jun 28 19:32:54 fmac.local systemd[1]: Finished Create swap on /dev/zram0. | ||
</pre> | |||
</ol> | </ol> | ||
|results= | |results= | ||
# | # Stopping the service should work without issues and it should remove the `/dev/zram0` device, i.e. it will no longer be visible in `zramctl` and `swapon` commands output. | ||
}} | }} | ||
[[Category:Test Days Test Cases]] | [[Category:Test Days Test Cases]] |
Revision as of 14:56, 1 July 2020
Description
Test stopping the swap-on-zram service temporarily.
Setup
- A system with swap-on-zram installed and enabled.
How to test
- Stop the swap-on-zram service:
sudo systemctl stop swap-create@zram0.service
- Confirm it's stopped. 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) since Sun 2020-06-28 19:32:07 MDT; 3s 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) Process: 1565 ExecStop=/usr/lib/systemd/system-generators/zram-generator --reset-device zram0 (code=exited, status=0/SUCCESS) Main PID: 646 (code=exited, status=0/SUCCESS) CPU: 25ms 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. Jun 28 19:32:07 fmac.local systemd[1]: Stopping Create swap on /dev/zram0... Jun 28 19:32:07 fmac.local systemd[1]: swap-create@zram0.service: Succeeded. Jun 28 19:32:07 fmac.local systemd[1]: Stopped Create swap on /dev/zram0.
zramctl
should list no device:$ zramctl
swapon
should only list your disk swap partitions and no/dev/zram0
device:$ swapon NAME TYPE SIZE USED PRIO /dev/sda5 partition 10.4G 0B -2
- Start the swap-on-zram service again and confirm it's running:
$ sudo systemctl start swap-create@zram0.service $ sudo systemctl status swap-create@zram0 ● 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:32:54 MDT; 3s ago Docs: man:zram-generator(8) man:zram-generator.conf(5) Process: 1580 ExecStart=/usr/lib/systemd/system-generators/zram-generator --setup-device zram0 (code=exited, status=0/SUCCESS) Main PID: 1580 (code=exited, status=0/SUCCESS) CPU: 33ms Jun 28 19:32:54 fmac.local systemd[1]: Starting Create swap on /dev/zram0... Jun 28 19:32:54 fmac.local zram-generator[1582]: Setting up swapspace version 1, size = 3.8 GiB (4105170944 bytes) Jun 28 19:32:54 fmac.local zram-generator[1582]: no label, UUID=f046c6d8-3f69-4f21-81ae-a7b1555891d9 Jun 28 19:32:54 fmac.local systemd[1]: Finished Create swap on /dev/zram0.
Expected Results
- Stopping the service should work without issues and it should remove the
/dev/zram0
device, i.e. it will no longer be visible inzramctl
andswapon
commands output.