]> git.baikalelectronics.ru Git - uboot.git/commitdiff
test/py: mmc: Add 'mmc dev' test
authorMarek Vasut <marek.vasut@gmail.com>
Wed, 13 Mar 2019 16:49:26 +0000 (17:49 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 10 Apr 2019 00:04:04 +0000 (20:04 -0400)
Add separate test for 'mmc dev' subcommand. This tests whether
the system can switch to a specific card.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/py/tests/test_mmc_rd.py

index 40ae1a84592199384e8c3085ac6ffbd85a0d6a5b..1337074d3fbe9fdf17ff608ef5febb7b34244503 100644 (file)
@@ -83,6 +83,27 @@ def mmc_dev(u_boot_console, is_emmc, devid, partid):
     good_response = 'mmc%d%s is current device' % (devid, partid_response)
     assert good_response in response
 
+@pytest.mark.buildconfigspec('cmd_mmc')
+def test_mmc_dev(u_boot_console, env__mmc_rd_config):
+    """Test the "mmc dev" command.
+
+    Args:
+        u_boot_console: A U-Boot console connection.
+        env__mmc_rd_config: The single MMC configuration on which
+            to run the test. See the file-level comment above for details
+            of the format.
+
+    Returns:
+        Nothing.
+    """
+
+    is_emmc = env__mmc_rd_config['is_emmc']
+    devid = env__mmc_rd_config['devid']
+    partid = env__mmc_rd_config.get('partid', 0)
+
+    # Select MMC device
+    mmc_dev(u_boot_console, is_emmc, devid, partid)
+
 @pytest.mark.buildconfigspec('cmd_mmc')
 def test_mmc_rd(u_boot_console, env__mmc_rd_config):
     """Test the "mmc read" command.