From 13b0c02339a072150633366876a8688cdfb38c6d Mon Sep 17 00:00:00 2001 From: Jonathan Cave Date: Thu, 10 Sep 2020 16:53:21 +0100 Subject: 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. --- bin/fde_tests.py | 14 ++++++++------ 1 file 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 -- cgit v1.2.3