]> git.sur5r.net Git - u-boot/blobdiff - test/py/tests/test_dfu.py
test/py: dfu: error out if USB device already exists
[u-boot] / test / py / tests / test_dfu.py
index cc4b8d8e04e615734a71fe7444c1fc5488615da3..6c1a363b02df0823d06eee1c0b3e5aa35183657c 100644 (file)
@@ -100,6 +100,12 @@ def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config):
             Nothing.
         '''
 
+        fh = u_boot_utils.attempt_to_open_file(
+            env__usb_dev_port['host_usb_dev_node'])
+        if fh:
+            fh.close()
+            raise Exception('USB device present before dfu command invoked')
+
         u_boot_console.log.action(
             'Starting long-running U-Boot dfu shell command')