* [U-Boot] [PATCH] test/py: gpt: update size of gpt partition
@ 2017-12-06 17:08 Patrick Delaunay
2017-12-06 17:26 ` Stephen Warren
2017-12-13 22:56 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Patrick Delaunay @ 2017-12-06 17:08 UTC (permalink / raw)
To: u-boot
- avoid disturbing 0MiB partition size (in fact < 1MiB)
- test overlap limit between part1 and part2
- test gpt write with data with modifier 'M' for MiB
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
test ok on v2018.01-rc1
./test/py/test.py -B sandbox
=> test/py/tests/test_gpt.py .......
Modification was initially proposed by Stephen Warren in review of
[PATCH v1 1/3] test/py: gpt: update test_gpt
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
If you're looking for more things to change(!), perhaps
change the sgdisk commands so that the partitions are
big enough that 'gpt read host 0' says something other
than 'size 0MiB' for the partitions; when I saw that,
I was initially rather confused until I realized that
the partitions were less than 1MiB!
Patrick Delaunay wrote:
I don't really looking...
but I agree: size 0MiB is confusing,
I had the same reaction the first time.
So I will propose something when this serie will be accepted,
just update the test to have 2 partitions with different size
and > 1MiB.
test/py/tests/test_gpt.py | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py
index 4329b69..886df43 100644
--- a/test/py/tests/test_gpt.py
+++ b/test/py/tests/test_gpt.py
@@ -44,9 +44,11 @@ class GptTestDiskImage(object):
cmd = ('sgdisk', '-U', '375a56f7-d6c9-4e81-b5f0-09d41ca89efe',
persistent)
u_boot_utils.run_and_log(u_boot_console, cmd)
- cmd = ('sgdisk', '--new=1:2048:2560', '-c 1:part1', persistent)
+ # part1 offset 1MB size 1MB
+ cmd = ('sgdisk', '--new=1:2048:4095', '-c 1:part1', persistent)
+ # part2 offset 2MB size 1.5MB
u_boot_utils.run_and_log(u_boot_console, cmd)
- cmd = ('sgdisk', '--new=2:4096:4608', '-c 2:part2', persistent)
+ cmd = ('sgdisk', '--new=2:4096:7167', '-c 2:part2', persistent)
u_boot_utils.run_and_log(u_boot_console, cmd)
cmd = ('sgdisk', '-l', persistent)
u_boot_utils.run_and_log(u_boot_console, cmd)
@@ -76,13 +78,13 @@ def test_gpt_read(state_disk_image, u_boot_console):
u_boot_console.run_command('host bind 0 ' + state_disk_image.path)
output = u_boot_console.run_command('gpt read host 0')
- assert 'Start 1MiB, size 0MiB' in output
+ assert 'Start 1MiB, size 1MiB' in output
assert 'Block size 512, name part1' in output
- assert 'Start 2MiB, size 0MiB' in output
+ assert 'Start 2MiB, size 1MiB' in output
assert 'Block size 512, name part2' in output
output = u_boot_console.run_command('part list host 0')
- assert '0x00000800 0x00000a00 "part1"' in output
- assert '0x00001000 0x00001200 "part2"' in output
+ assert '0x00000800 0x00000fff "part1"' in output
+ assert '0x00001000 0x00001bff "part2"' in output
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_gpt')
@@ -133,8 +135,8 @@ def test_gpt_rename_partition(state_disk_image, u_boot_console):
output = u_boot_console.run_command('gpt read host 0')
assert 'name second' in output
output = u_boot_console.run_command('part list host 0')
- assert '0x00000800 0x00000a00 "first"' in output
- assert '0x00001000 0x00001200 "second"' in output
+ assert '0x00000800 0x00000fff "first"' in output
+ assert '0x00001000 0x00001bff "second"' in output
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_gpt')
@@ -146,12 +148,12 @@ 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 '0x00000800 0x00000a00 "first"' in output
- assert '0x00001000 0x00001200 "second"' in output
+ assert '0x00000800 0x00000fff "first"' in output
+ assert '0x00001000 0x00001bff "second"' in output
u_boot_console.run_command('gpt swap host 0 first second')
output = u_boot_console.run_command('part list host 0')
- assert '0x00000800 0x00000a00 "second"' in output
- assert '0x00001000 0x00001200 "first"' in output
+ assert '0x00000800 0x00000fff "second"' in output
+ assert '0x00001000 0x00001bff "first"' in output
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_gpt')
@@ -165,10 +167,10 @@ def test_gpt_write(state_disk_image, u_boot_console):
assert 'Writing GPT: success!' in output
output = u_boot_console.run_command('part list host 0')
assert '0x00000022 0x00001fde "all"' in output
- output = u_boot_console.run_command('gpt write host 0 "uuid_disk=375a56f7-d6c9-4e81-b5f0-09d41ca89efe;name=first,start=0x100000,size=0x40200;name=second,start=0x200000,size=0x40200;"')
+ output = u_boot_console.run_command('gpt write host 0 "uuid_disk=375a56f7-d6c9-4e81-b5f0-09d41ca89efe;name=first,start=1M,size=1M;name=second,start=0x200000,size=0x180000;"')
assert 'Writing GPT: success!' in output
output = u_boot_console.run_command('part list host 0')
- assert '0x00000800 0x00000a00 "first"' in output
- assert '0x00001000 0x00001200 "second"' in output
+ assert '0x00000800 0x00000fff "first"' in output
+ assert '0x00001000 0x00001bff "second"' in output
output = u_boot_console.run_command('gpt guid host 0')
assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] test/py: gpt: update size of gpt partition
2017-12-06 17:08 [U-Boot] [PATCH] test/py: gpt: update size of gpt partition Patrick Delaunay
@ 2017-12-06 17:26 ` Stephen Warren
2017-12-13 22:56 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2017-12-06 17:26 UTC (permalink / raw)
To: u-boot
On 12/06/2017 10:08 AM, Patrick Delaunay wrote:
> - avoid disturbing 0MiB partition size (in fact < 1MiB)
> - test overlap limit between part1 and part2
> - test gpt write with data with modifier 'M' for MiB
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] test/py: gpt: update size of gpt partition
2017-12-06 17:08 [U-Boot] [PATCH] test/py: gpt: update size of gpt partition Patrick Delaunay
2017-12-06 17:26 ` Stephen Warren
@ 2017-12-13 22:56 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2017-12-13 22:56 UTC (permalink / raw)
To: u-boot
On Wed, Dec 06, 2017 at 06:08:20PM +0100, Patrick Delaunay wrote:
> - avoid disturbing 0MiB partition size (in fact < 1MiB)
> - test overlap limit between part1 and part2
> - test gpt write with data with modifier 'M' for MiB
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Reviewed-by: Stephen Warren <swarren@nvidia.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171213/55cbb218/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-13 22:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 17:08 [U-Boot] [PATCH] test/py: gpt: update size of gpt partition Patrick Delaunay
2017-12-06 17:26 ` Stephen Warren
2017-12-13 22:56 ` [U-Boot] " Tom Rini
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.