File: task.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (20 lines) | stat: -rw-r--r-- 644 bytes parent folder | download | duplicates (3)
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+'"