[parted-devel] [PATCH 1/2] tests: t2300-dos-label-extended-bootcode.sh: various fixes
Petr Uzel
petr.uzel at suse.cz
Tue Aug 25 12:48:44 UTC 2009
* fix typo where only first 400B of fake bootcode was installed
(should be 440)
* use bootcode_size variable instead of plain 440
* use ../Makefile as a source for random bootcode data instead of
/dev/urandom which might not exist
Signed-off-by: Petr Uzel <petr.uzel at suse.cz>
---
tests/t2300-dos-label-extended-bootcode.sh | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tests/t2300-dos-label-extended-bootcode.sh b/tests/t2300-dos-label-extended-bootcode.sh
index f2f3a83..b07bd11 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=440
test_expect_success \
'Create the test file' \
@@ -47,12 +46,12 @@ 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 \
+ 'dd if=../Makefile 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 +60,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' \
--
1.6.3.3
--
Best regards / s pozdravem
Petr Uzel, openSUSE Community Multiplier Team
-----------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: puzel at suse.cz
Lihovarská 1060/12 http://www.suse.cz
190 00 Prague 9, CR
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20090825/ee8b6e83/attachment.pgp>
More information about the parted-devel
mailing list