test: Add a 'make qcheck' target for quicker testing
[oweals/u-boot.git] / test / py / tests / test_ums.py
index f482cfeca1b144b4985745455fccd6aa69c7cf6c..e8eb43c76b7c5b3cf531b4ac7cd2067042d5e086 100644 (file)
@@ -1,6 +1,5 @@
-# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
-#
 # SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
 
 # Test U-Boot's "ums" command. The test starts UMS in U-Boot, waits for USB
 # device enumeration on the host, reads a small block of data from the UMS
@@ -14,7 +13,7 @@ import re
 import time
 import u_boot_utils
 
-'''
+"""
 Note: This test relies on:
 
 a) boardenv_* to contain configuration values to define which USB ports are
@@ -29,6 +28,7 @@ env__mount_points = (
 
 env__usb_dev_ports = (
     {
+        "fixture_id": "micro_b",
         "tgt_usb_ctlr": "0",
         "host_ums_dev_node": "/dev/disk/by-path/pci-0000:00:14.0-usb-0:13:1.0-scsi-0:0:0:0",
     },
@@ -37,6 +37,7 @@ env__usb_dev_ports = (
 env__block_devs = (
     # eMMC; always present
     {
+        "fixture_id": "emmc",
         "type": "mmc",
         "id": "0",
         # The following two properties are optional.
@@ -48,6 +49,7 @@ env__block_devs = (
     },
     # SD card; present since I plugged one in
     {
+        "fixture_id": "sd",
         "type": "mmc",
         "id": "1"
     },
@@ -69,11 +71,11 @@ root permissions. For example:
 
 This entry is only needed if any block_devs above contain a
 writable_fs_partition value.
-'''
+"""
 
 @pytest.mark.buildconfigspec('cmd_usb_mass_storage')
 def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
-    '''Test the "ums" command; the host system must be able to enumerate a UMS
+    """Test the "ums" command; the host system must be able to enumerate a UMS
     device when "ums" is running, block and optionally file I/O are tested,
     and this device must disappear when "ums" is aborted.
 
@@ -88,7 +90,7 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
 
     Returns:
         Nothing.
-    '''
+    """
 
     have_writable_fs_partition = 'writable_fs_partition' in env__block_devs[0]
     if not have_writable_fs_partition:
@@ -120,7 +122,7 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
         mounted_test_fn = mount_point + '/' + mount_subdir + test_f.fn
 
     def start_ums():
-        '''Start U-Boot's ums shell command.
+        """Start U-Boot's ums shell command.
 
         This also waits for the host-side USB enumeration process to complete.
 
@@ -129,7 +131,7 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
 
         Returns:
             Nothing.
-        '''
+        """
 
         u_boot_console.log.action(
             'Starting long-running U-Boot ums shell command')
@@ -142,21 +144,21 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
         fh.close()
 
     def mount():
-        '''Mount the block device that U-Boot exports.
+        """Mount the block device that U-Boot exports.
 
         Args:
             None.
 
         Returns:
             Nothing.
-        '''
+        """
 
         u_boot_console.log.action('Mounting exported UMS device')
         cmd = ('/bin/mount', host_ums_part_node)
         u_boot_utils.run_and_log(u_boot_console, cmd)
 
     def umount(ignore_errors):
-        '''Unmount the block device that U-Boot exports.
+        """Unmount the block device that U-Boot exports.
 
         Args:
             ignore_errors: Ignore any errors. This is useful if an error has
@@ -166,14 +168,14 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
 
         Returns:
             Nothing.
-        '''
+        """
 
         u_boot_console.log.action('Unmounting UMS device')
         cmd = ('/bin/umount', host_ums_part_node)
         u_boot_utils.run_and_log(u_boot_console, cmd, ignore_errors)
 
     def stop_ums(ignore_errors):
-        '''Stop U-Boot's ums shell command from executing.
+        """Stop U-Boot's ums shell command from executing.
 
         This also waits for the host-side USB de-enumeration process to
         complete.
@@ -186,7 +188,7 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
 
         Returns:
             Nothing.
-        '''
+        """
 
         u_boot_console.log.action(
             'Stopping long-running U-Boot ums shell command')