]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test: mmc: Do not run mmc/sd test if sd/mmc is not present
authorMichal Simek <michal.simek@xilinx.com>
Mon, 8 Jan 2018 15:16:55 +0000 (16:16 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 31 Jan 2018 12:15:43 +0000 (13:15 +0100)
Skip tests if card is not present.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_mmc.py

index b050577f3efdca6429ed385b88d8dc2503ffae44..80e10d4d3d16110c454374a82e53aabc8727fef0 100644 (file)
@@ -18,6 +18,9 @@ def test_mmc_list(u_boot_console):
     if "No MMC device available" in output:
         pytest.skip('No SD/MMC/eMMC controller available')
 
+    if "Card did not respond to voltage select" in output:
+        pytest.skip('No SD/MMC card present')
+
     array = output.split( )
 
     global devices
@@ -38,14 +41,16 @@ def test_mmc_dev(u_boot_console):
 
     fail = 0
     for x in range(0, controllers):
+        devices[x]["detected"] = "yes"
         output = u_boot_console.run_command('mmc dev %d' % x)
 
         # Some sort of switch here
         if "Card did not respond to voltage select" in output:
             fail = 1
             devices[x]["detected"] = "no"
-        else:
-            devices[x]["detected"] = "yes"
+
+        if "no mmc device at slot" in output:
+            devices[x]["detected"] = "no"
 
     if fail:
         pytest.fail("Card not present")