diff options
author | Petr Uzel <petr.uzel@suse.cz> | 2009-08-26 15:10:31 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-08-26 16:04:46 +0200 |
commit | d5d8f07c62639689a949b9c233b2a01f935d447c (patch) | |
tree | b98ce662aaf335e5fd000ecec0750888660624e7 /tests/t2300-dos-label-extended-bootcode.sh | |
parent | c8ad4b582d9b6d60e519dde1893ddb17f56a6e01 (diff) | |
download | parted-d5d8f07c62639689a949b9c233b2a01f935d447c.tar.gz |
tests: t2300-dos-label-extended-bootcode.sh: various fixes
* tests/t2300-dos-label-extended-bootcode.sh:
- fix typo where only first 400B of fake bootcode was installed
- use bootcode_size variable and increase its value from 440 to 446
- do not use /dev/urandom since it might not exist
Diffstat (limited to 'tests/t2300-dos-label-extended-bootcode.sh')
-rwxr-xr-x | tests/t2300-dos-label-extended-bootcode.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/t2300-dos-label-extended-bootcode.sh b/tests/t2300-dos-label-extended-bootcode.sh index f2f3a83..a0dd2e9 100755 --- a/tests/t2300-dos-label-extended-bootcode.sh +++ b/tests/t2300-dos-label-extended-bootcode.sh @@ -22,9 +22,8 @@ test_description='Ensure parted preserves bootcode in extended partition.' require_512_byte_sector_size_ -# Note: the bootcode size is 440B - dev=loop-file +bootcode_size=446 test_expect_success \ 'Create the test file' \ @@ -47,12 +46,13 @@ test_expect_success 'Expect no output' 'compare out /dev/null' test_expect_success \ 'Install fake bootcode' \ - 'dd if=/dev/urandom of=$dev bs=1c seek=16384 count=400 \ - conv=notrunc > /dev/null 2>&1' + 'printf %0${bootcode_size}d 0 > in && + dd if=in of=$dev bs=1c seek=16384 count=$bootcode_size \ + conv=notrunc > /dev/null 2>&1' test_expect_success \ 'Save fake bootcode for later comparison' \ - 'dd if=$dev of=before bs=1 skip=16384 count=440 > /dev/null 2>&1' + 'dd if=$dev of=before bs=1 skip=16384 count=$bootcode_size > /dev/null 2>&1' test_expect_success \ 'Do something to the label' \ @@ -61,7 +61,7 @@ test_expect_success 'Expect no output' 'compare out /dev/null' test_expect_success \ 'Extract the bootcode for comparison' \ - 'dd if=$dev of=after bs=1 skip=16384 count=440 > /dev/null 2>&1' + 'dd if=$dev of=after bs=1 skip=16384 count=$bootcode_size > /dev/null 2>&1' test_expect_success \ 'Expect bootcode has not changed' \ |