Merge ~pwlars/plainbox-provider-checkbox:no-storage-device-test-crypto into plainbox-provider-checkbox:master

Proposed by Paul Larson
Status: Merged
Approved by: Paul Larson
Approved revision: b79b11d28205f2d92d099e223f60cf4be7a8257c
Merged at revision: 80fe2419f879820bb6737543c199891540fec80f
Proposed branch: ~pwlars/plainbox-provider-checkbox:no-storage-device-test-crypto
Merge into: plainbox-provider-checkbox:master
Diff against target: 19 lines (+3/-3)
1 file modified
bin/storage_test.py (+3/-3)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+430841@code.launchpad.net

Description of the change

Small optimization to skip adding partitions if we couldn't detect the filesystem (those won't be considered anyway). But the main purpose here was to skip partitions that have the fs type "crypto_LUKS" since we can't use them for this test. I found this when running http://10.102.156.15:8080/job/cert-thinkedge-se30-intel-kernel-20-beta/3/testReport/junit/com.canonical/certification__disk_storage_device_nvme0n1/com_canonical_certification__disk_storage_device_nvme0n1/

Log:
Testing disk nvme0n1
identified as a disk...
test will be run on partition /dev/nvme0n1p5
+ mount /dev/nvme0n1p5 /tmp/tmpje0opw2v
mount: /tmp/tmpje0opw2v: unknown filesystem type 'crypto_LUKS'.
Traceback (most recent call last):
  File "/tmp/nest-punomw35.31c87e8f098638c0afa1eb324ec91d6eadc1613fa55a5682526f26226262a817/storage_test.py", line 152, in <module>
    main()
  File "/tmp/nest-punomw35.31c87e8f098638c0afa1eb324ec91d6eadc1613fa55a5682526f26226262a817/storage_test.py", line 148, in main
    disk_test(udev_name)
  File "/tmp/nest-punomw35.31c87e8f098638c0afa1eb324ec91d6eadc1613fa55a5682526f26226262a817/storage_test.py", line 134, in disk_test
    mount(part_to_test, mount_dir)
  File "/tmp/nest-punomw35.31c87e8f098638c0afa1eb324ec91d6eadc1613fa55a5682526f26226262a817/storage_test.py", line 50, in mount
    sp.check_call(cmd, shell=True)
  File "/snap/checkbox/1929/checkbox-runtime/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'mount /dev/nvme0n1p5 /tmp/tmpje0opw2v' returned non-zero exit status 32.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks for the fix, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/storage_test.py b/bin/storage_test.py
2index 58453e2..d239b9d 100755
3--- a/bin/storage_test.py
4+++ b/bin/storage_test.py
5@@ -32,11 +32,11 @@ def find_largest_partition(device):
6 for entry in out.decode(sys.stdout.encoding).splitlines():
7 params = entry.strip().split()
8 if len(params) == 3:
9- # filesystem info missing, so it's unknown
10- params.append(None)
11+ # filesystem info missing, so it's unknown - skip
12+ continue
13 blk_devs.append(BlkDev(*params))
14 blk_devs[:] = [bd for bd in blk_devs if (
15- bd.type in ('part', 'md') and bd.fstype is not None)]
16+ bd.type in ('part', 'md') and bd.fstype != "crypto_LUKS")]
17 if not blk_devs:
18 raise SystemExit(
19 'ERROR: No suitable partitions found on device {}'.format(device))

Subscribers

People subscribed via source and target branches