[U-Boot] [PATCH v1 1/3] test/py: gpt: update test_gpt

Stephen Warren swarren at wwwdotorg.org
Tue Oct 10 15:59:18 UTC 2017


On 10/10/2017 06:50 AM, Patrick DELAUNAY wrote:
> Hi Stephen,
> 
>> -----Original Message-----
>> From: Stephen Warren [mailto:swarren at wwwdotorg.org]
>>
>> On 10/09/2017 01:47 AM, Patrick Delaunay wrote:
>>> - copy the reference gpt binary file as it is modified during the test
>>>     to avoid issue if the test fail: the test always restart with clean
>>> file
>>> - update tests to highlight detected issues on gpt swap command
>>>     (offset and size of partition are modified)
>>> - add test for gpt verfiy, gpt read and gpt write

>>> @@ -109,9 +142,29 @@ def test_gpt_swap_partitions(state_disk_image, u_boot_console):
>>>
>>>        u_boot_console.run_command('host bind 0 ' + state_disk_image.path)
>>>        output = u_boot_console.run_command('part list host 0')
>>> -    assert '0x000007ff	"first"' in output
>>> -    assert '0x000017ff	"second"' in output
>>> +    assert '0x00000800	0x00000a00	"first"' in output
>>> +    assert '0x00001000	0x00001200	"second"' in output
>>
>> I'm not sure why this change is required. I can see two separate changes
>> here:
>>
>> 1) Verifies the value of 3 columns of data not just 2. That seems fine.
>>
>> 2) Changes the expected value in the column before the partition name.
>> I'm not sure about this; shouldn't the value stay the same, or is the test failing
>> right now?
> 
> in fact it the purpose of my modification in patch 3/3 : cmd: gpt: solve issue for swap
> 
> The command gpt swap (or gpt remane) don't expect change the offset or the size of the partition
> but it is the case today , it is an error in code and it is not detected with the current test
> 
> In the modified test, I test the expected correct values (3 columns): without modification of the offset and size.
> 
> => the test if failing for master branch
> => the test is OK only after " patch 3/3 : cmd: gpt: solve issue for swap"
> 
> But I don't sure of the correct patchset order to avoid issue during merge in master branch
> 
> First Test update  => test Failed
> Then patch the code => test OK
> 
> Or
> 
> First patch the code => test Failed
> Then patch the test => test OK

I'd suggest something like:

Patch 1: Modify the test to check the value for all 3 columns in a way 
that passes with the current implementation of the command. Perhaps add 
a comment that there's a bug in the code, and remove it in the next 
patch. The test should pass both before and after this patch.

Patch 2: Fix the bug in the GPT command, and in the same patch, change 
the values that test_gpt expects so that it passes again. The test 
should pass both before and after this patch.


More information about the U-Boot mailing list