[PATCH] mtd-utils: tests: avoid using only one block in nandpagetest
David Oberhollenzer
david.oberhollenzer at sigma-star.at
Thu Aug 24 01:40:09 PDT 2017
Hi,
On 08/23/2017 03:57 PM, Miquel Raynal wrote:
> Forbid the use of -c1 in nandpagetest which limits the number of blocks
> to use at one. In that case, get_first_and_last_block() will return the
> same id for both the first and the last blocks. In erasecrosstest(),
> the logic is:
> - erase/write/read/verify first block
> - erase/write again first block
> - erase *last* block
> - read/verify first block
> The case 'first == last' leads to erasing the block before reading it.
> Hence the test will fail with no actual reason.
>
So if some existing automated test setup were to use this, it would
(as of right now) *always* fail and terminate with EXIT_FAILURE.
> The patch does not forbid the use of -c1 as it could do it in
> process_options() with a errmsg_die(). Instead, it warns the user and
> uses a second block in order to avoid risking to break existing scripts.
>
But wouldn't exactly that change the behavior of such a setup by suddenly
having all tests succeed?
If this combination of options always fails anyway, wouldn't it be more
appropriate to terminate with an error message in process_options instead?
Thanks,
David
More information about the linux-mtd
mailing list