Merge ~pkopylov/qa-regression-testing:fix-test-util-linux-swapon into qa-regression-testing:master
Proposed by
Pavel Kopylov
Status: | Needs review |
---|---|
Proposed branch: | ~pkopylov/qa-regression-testing:fix-test-util-linux-swapon |
Merge into: | qa-regression-testing:master |
Diff against target: |
43 lines (+17/-3) 1 file modified
scripts/test-util-linux.py (+17/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Security Team | Pending | ||
Review via email: mp+442107@code.launchpad.net |
Description of the change
There is a problem with the swapon utility. Here is the display_
Also, the swapon's manual declares command line keys --summary and -s as deprecated, so the right solution is using a similar key named --show.
So, I suggest checking if /proc/swaps exists at all and if this file contains at least two strings (because the first string in this file is just titles).
To post a comment you must log in.
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!