diff options
author | Paul Larson <paul.larson@ubuntu.com> | 2019-12-16 12:39:30 -0600 |
---|---|---|
committer | Paul Larson <paul.larson@ubuntu.com> | 2019-12-16 12:39:30 -0600 |
commit | cc0277ef01141822db392409ab7e0225b513d099 (patch) | |
tree | 797ebe9f26c1706586bfebf45a1f91f6b7639f5b | |
parent | 9fd3ae13a9416e4508ecc3e850968f466754db35 (diff) |
Also fail the usb-storage-preinserted tests if there are IO errors, or if it takes too long
-rwxr-xr-x | bin/removable_storage_test | 6 | ||||
-rw-r--r-- | units/usb/usb.pxu | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/bin/removable_storage_test b/bin/removable_storage_test index 249911a..bbace30 100755 --- a/bin/removable_storage_test +++ b/bin/removable_storage_test @@ -729,6 +729,8 @@ def main(): total_write_size = sum(write_sizes) try: + # Clear dmesg so we can check for I/O errors later + subprocess.check_output(['dmesg', '-C']) for disk, mount_point in disks_eligible.items(): print("%s (Total Data Size / iteration: %0.4f MB):" % (disk, (total_write_size / 1024 / 1024))) @@ -807,6 +809,10 @@ def main(): if test.umount() != 0: errors += 1 test.clean_tmp_dir() + dmesg = subprocess.run(['dmesg'], stdout=subprocess.PIPE) + if 'I/O error' in dmesg.stdout.decode(): + logging.error("I/O errors found in dmesg") + errors += 1 if errors > 0: logging.warning( diff --git a/units/usb/usb.pxu b/units/usb/usb.pxu index ffc9f3c..5481f8d 100644 --- a/units/usb/usb.pxu +++ b/units/usb/usb.pxu @@ -234,7 +234,7 @@ category_id: com.canonical.plainbox::usb id: usb/storage-preinserted user: root estimated_duration: 45.0 -command: removable_storage_test -l usb && removable_storage_test -s 268400000 usb +command: removable_storage_test -l usb && timeout 300 removable_storage_test -s 268400000 usb flags: also-after-suspend preserve-cwd requires: cpuinfo.platform != 's390x' @@ -258,7 +258,7 @@ requires: package.name == 'udisks2' or snap.name == 'udisks2' package.name == 'udisks2' or (snap.name == 'core' and int(snap.revision) >= 1804) estimated_duration: 45.0 -command: removable_storage_test -l usb && removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd +command: removable_storage_test -l usb && timeout 300 removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd _summary: Test USB 3.0 or 3.1 ports _description: |