tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/config/swap: check failure in swap file test
Mikaela Allan
2 years ago
9b47ad66
3fedce78
+4
1 changed file
expand all
collapse all
unified
split
nixos
tests
swap-file-btrfs.nix
+4
nixos/tests/swap-file-btrfs.nix
···
32
32
33
33
testScript = ''
34
34
machine.wait_for_unit('var-swapfile.swap')
35
35
+
# Ensure the swap file creation script ran to completion without failing when creating the swap file
36
36
+
machine.fail("systemctl is-failed --quiet mkswap-var-swapfile.service")
35
37
machine.succeed("stat --file-system --format=%T /var/swapfile | grep btrfs")
36
38
# First run. Auto creation.
37
39
machine.succeed("swapon --show | grep /var/swapfile")
···
41
43
42
44
# Second run. Use it as-is.
43
45
machine.wait_for_unit('var-swapfile.swap')
46
46
+
# Ensure the swap file creation script ran to completion without failing when the swap file already exists
47
47
+
machine.fail("systemctl is-failed --quiet mkswap-var-swapfile.service")
44
48
machine.succeed("swapon --show | grep /var/swapfile")
45
49
'';
46
50
})