1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
summary: Ensure that we can create swapfiles
details: |
Check that snapd allows to create swapfiles with a specific size through
the 'swap.size' config. Verify also that unsetting the config removes
the swapfile.
execute: |
echo "Set swap size to 200M"
snap set system swap.size=200M
echo "Check that the swap file was setup"
# use swapon as it rounds up the numbers nicely
retry -n 60 --wait 1 bash -c "swapon --show | MATCH '\s+file\s+200M\s'"
echo "Unset the swap size"
snap unset system swap.size
echo "Check that there is no more swap now"
retry -n 60 --wait 1 bash -c "cat /proc/swaps | NOMATCH '\s+file\s+'"
|