Hay Pavel, thanks for submitting this. One issue with converting to swapon --show is that the Ubuntu Security Team is still supporting 14.04 LTS / trusty, where the swapon command does not support the --show argument.
I have pushed a commit that will use swapon --show in newer releases, and also checks the contents of /proc/swaps, and doesn't expect any output from swapon if there's no entries besides the column headers in /proc/swaps. Probably the better solution is to always create a small swapfile and check the output of swapon to ensure it's present.
Hay Pavel, thanks for submitting this. One issue with converting to swapon --show is that the Ubuntu Security Team is still supporting 14.04 LTS / trusty, where the swapon command does not support the --show argument.
I have pushed a commit that will use swapon --show in newer releases, and also checks the contents of /proc/swaps, and doesn't expect any output from swapon if there's no entries besides the column headers in /proc/swaps. Probably the better solution is to always create a small swapfile and check the output of swapon to ensure it's present.
The commit is at https:/ /git.launchpad. net/qa- regression- testing/ commit/ ?id=079add3ae18 12d37164c80cf06 ff6d399a8b27c3
Thanks!