Merge branch 'master' of git://git.denx.de/u-boot-spi
[oweals/u-boot.git] / test / py / tests / test_dfu.py
index 585e6b29d7f8b470efe303ab5776a370194727c9..a24600376cb73e663d43dd40bc8d44f9daf6cf45 100644 (file)
@@ -1,6 +1,5 @@
-# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
-#
 # SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
 
 # Test U-Boot's "dfu" command. The test starts DFU in U-Boot, waits for USB
 # device enumeration on the host, executes dfu-util multiple times to test
@@ -80,6 +79,13 @@ ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb", KERNELS=="3-13", MODE:="66
 (You may wish to change the group ID instead of setting the permissions wide
 open. All that matters is that the user ID running the test can access the
 device.)
+
+c) An optional udev rule to give you a persistent value to use in
+host_usb_dev_node. For example:
+
+IMPORT{builtin}="path_id"
+ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="bus/usb/by-path/$env{ID_PATH}"
+ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="bus/usb/by-path/$env{ID_PATH}-port$env{.ID_PORT}"
 """
 
 # The set of file sizes to test. These values trigger various edge-cases such
@@ -106,6 +112,7 @@ test_sizes_default = (
 first_usb_dev_port = None
 
 @pytest.mark.buildconfigspec('cmd_dfu')
+@pytest.mark.requiredtool('dfu-util')
 def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config):
     """Test the "dfu" command; the host system must be able to enumerate a USB
     device when "dfu" is running, various DFU transfers are tested, and the