diff options
| author | Jonathan Cave <jonathan.cave@canonical.com> | 2020-09-10 16:53:21 +0100 |
|---|---|---|
| committer | Jonathan Cave <jonathan.cave@canonical.com> | 2020-09-10 16:53:21 +0100 |
| commit | 13b0c02339a072150633366876a8688cdfb38c6d (patch) | |
| tree | 8527a29fb831f7fd760f2ece0ef38b34aa2b6f93 | |
| parent | 412ec6faaa246fd178f0a49bfcb79792e7477b58 (diff) | |
fde_tests.py: update FDE detect for UC20
Update the script used by the disk/encryption/detect job to work on UC20. The writable partition is now know as ubuntu-data in this release.
| -rwxr-xr-x | bin/fde_tests.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/fde_tests.py b/bin/fde_tests.py index 276f283..cc75a69 100755 --- a/bin/fde_tests.py +++ b/bin/fde_tests.py @@ -20,25 +20,27 @@ import re import subprocess as sp import sys +from checkbox_support.snap_utils.system import get_series + def main(): on_desktop = len(sys.argv) > 1 and sys.argv[1] == 'desktop' - # the mountpoint corresponding to the on disk encrypted partition - base_mount = '/' if on_desktop else '/writable' - # discover the underlying mount point for the encrypted part if on_desktop: - cmd = 'findmnt {} -n -o SOURCE'.format(base_mount) + cmd = 'findmnt {} -n -o SOURCE'.format('/') else: - cmd = 'findfs LABEL=writable' + if int(get_series()) >= 20: + cmd = 'findfs LABEL=ubuntu-data' + else: + cmd = 'findfs LABEL=writable' print('+ {}'.format(cmd)) try: source = sp.check_output(cmd, shell=True).decode( sys.stdout.encoding).strip() except sp.CalledProcessError: raise SystemExit( - 'ERROR: could not find mountpoint for {}'.format(base_mount)) + 'ERROR: could not find mountpoint for the encrypted partition') print(source, '\n') # resolve the source to an actual device node |
