summaryrefslogtreecommitdiff
diff options
authorPMR <pmr@pmr-lander>2020-09-11 10:12:22 +0000
committerPMR <pmr@pmr-lander>2020-09-11 10:12:22 +0000
commitd61e14170e5330d9b2e6366f675a1abbb613c990 (patch)
tree8527a29fb831f7fd760f2ece0ef38b34aa2b6f93
parent412ec6faaa246fd178f0a49bfcb79792e7477b58 (diff)
parent13b0c02339a072150633366876a8688cdfb38c6d (diff)
Merge #390568 from ~jocave/plainbox-provider-checkbox:fde-detect-uc20
-rwxr-xr-xbin/fde_tests.py14
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