All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] test/py: mmc: Add 'mmc info' test
Date: Wed, 13 Mar 2019 17:49:28 +0100	[thread overview]
Message-ID: <20190313164929.32753-4-marek.vasut+renesas@gmail.com> (raw)
In-Reply-To: <20190313164929.32753-1-marek.vasut+renesas@gmail.com>

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 <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
---
 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
 
+ at 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

  parent reply	other threads:[~2019-03-13 16:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 16:49 [U-Boot] [PATCH 1/5] test/py: mmc: Factor out device selection Marek Vasut
2019-03-13 16:49 ` [U-Boot] [PATCH 2/5] test/py: mmc: Add 'mmc dev' test Marek Vasut
2019-03-19  1:23   ` Simon Glass
2019-04-10 12:20   ` [U-Boot] [U-Boot,2/5] " Tom Rini
2019-03-13 16:49 ` [U-Boot] [PATCH 3/5] test/py: mmc: Add 'mmc rescan' test Marek Vasut
2019-03-19  1:23   ` Simon Glass
2019-04-10 12:20   ` [U-Boot] [U-Boot,3/5] " Tom Rini
2019-03-13 16:49 ` Marek Vasut [this message]
2019-03-19  1:23   ` [U-Boot] [PATCH 4/5] test/py: mmc: Add 'mmc info' test Simon Glass
2019-04-10 12:20   ` [U-Boot] [U-Boot,4/5] " Tom Rini
2019-03-13 16:49 ` [U-Boot] [PATCH 5/5] test/py: mmc: Add 'mmc read' performance check Marek Vasut
2019-03-19  1:23   ` Simon Glass
2019-04-10 12:20   ` [U-Boot] [U-Boot, " Tom Rini
2019-03-19  1:23 ` [U-Boot] [PATCH 1/5] test/py: mmc: Factor out device selection Simon Glass
2019-04-10 12:20 ` [U-Boot] [U-Boot, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190313164929.32753-4-marek.vasut+renesas@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.