[U-Boot] mmc tests incorrectly implemented

Stephen Warren swarren at wwwdotorg.org
Wed Apr 10 15:12:40 UTC 2019


I see that some mmc tests have been added to test/py, but I see problems
with them:

1) test_mmc_rescan assumes that each entry in env__mmc_rd_configs is a
separate device that can be rescanned. This isn't actually true; entries
in that array are intended to drive the mmc read test, and so can point
at partitions or specific sector numbers. Running an mmc rescan test on
the entire array results in duplicated tests. A new data array should be
created for different tests.

2) It relies on test data that was not previously required. In
particular, I see new test failures because the "info_device" key is now
required. New tests should either (a) use new optional data arrays to
configure their operation, or (b) access any new data in an optional
way, skipping the test if it's not present, so as not to cause test
failures.

Also, shouldn't things like new tests be announced to the board
maintainers list, so that people can update their test/py configurations
to enable new tests if they're appropriate for their platform?

[-] Section: test_mmc_info[emmc-boot0]
FAILED:
u_boot_console = <u_boot_console_exec_attach.ConsoleExecAttach object at
0x7fafd88f2d10>
env__mmc_rd_config = {'count': 1, 'devid': 0, 'fixture_id':
'emmc-boot0', 'is_emmc': True, ...}

    @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']
E       KeyError: 'info_device'

src/u-boot/test/py/tests/test_mmc_rd.py:151: KeyError



More information about the U-Boot mailing list