Re: [U-Boot] [PATCH 4/5] test/py: mmc: Add 'mmc info' test

2019-03-18 Thread Simon Glass
On Thu, 14 Mar 2019 at 00:49, Marek Vasut  wrote:
>
> Add test for 'mmc info' subcommand. This tests whether the card
> information is obtained correctly and verifies the device, bus
> speed, bus mode and bus width.
>
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 
> Cc: Simon Glass 
> ---
>  test/py/tests/test_mmc_rd.py | 37 
>  1 file changed, 37 insertions(+)

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 4/5] test/py: mmc: Add 'mmc info' test

2019-03-13 Thread Marek Vasut
Add test for 'mmc info' subcommand. This tests whether the card
information is obtained correctly and verifies the device, bus
speed, bus mode and bus width.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
Cc: Simon Glass 
---
 test/py/tests/test_mmc_rd.py | 37 
 1 file changed, 37 insertions(+)

diff --git a/test/py/tests/test_mmc_rd.py b/test/py/tests/test_mmc_rd.py
index 86a57aafe5..aba512adfe 100644
--- a/test/py/tests/test_mmc_rd.py
+++ b/test/py/tests/test_mmc_rd.py
@@ -130,6 +130,43 @@ def test_mmc_rescan(u_boot_console, env__mmc_rd_config):
 response = u_boot_console.run_command(cmd)
 assert 'no card present' not in response
 
+@pytest.mark.buildconfigspec('cmd_mmc')
+def test_mmc_info(u_boot_console, env__mmc_rd_config):
+"""Test the "mmc info" 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)
+info_device = env__mmc_rd_config['info_device']
+info_speed = env__mmc_rd_config['info_speed']
+info_mode = env__mmc_rd_config['info_mode']
+info_buswidth = env__mmc_rd_config['info_buswidth']
+
+# Select MMC device
+mmc_dev(u_boot_console, is_emmc, devid, partid)
+
+# Read MMC device information
+cmd = 'mmc info'
+response = u_boot_console.run_command(cmd)
+good_response = "Device: %s" % info_device
+assert good_response in response
+good_response = "Bus Speed: %s" % info_speed
+assert good_response in response
+good_response = "Mode : %s" % info_mode
+assert good_response in response
+good_response = "Bus Width: %s" % info_buswidth
+assert good_response in response
+
 @pytest.mark.buildconfigspec('cmd_mmc')
 def test_mmc_rd(u_boot_console, env__mmc_rd_config):
 """Test the "mmc read" command.
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot