]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix fdisk/bsd for big endian systems
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 29 May 2014 17:52:52 +0000 (19:52 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 9 Jun 2014 10:58:05 +0000 (12:58 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/ts/fdisk/bsd

index 7e3c78726f71897d583b8c04134258cdc23e9787..be44b6370df8cab8665a06a7dcaa8bcafc8d6950 100755 (executable)
@@ -39,6 +39,17 @@ FDISK_CMD_BSD_LIST_TYPES="b\nl\nq\n"         # list supported PT types and quit
 
 #set -x
 
+# BSD disklabel depends on endianess
+BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order)
+function fdisk_bsd_byte_order_clean
+{
+       [ $BYTE_ORDER = "BE" ] || return
+       sed -i \
+       -e "s/c2273b52976351db75596c47c10b0725/2e1cee529cb59c9341afef0443f196a1/" \
+       -e "s/9a234a5b99e37d2ce0d92b65437b93cd/b5c121c2091b2ff26b880551feac7112/" \
+       "$TS_OUTPUT"
+}
+
 function print_layout {
        echo -ne "\n---layout----------" >> $TS_OUTPUT
        $TS_CMD_FDISK -l ${TEST_IMAGE_NAME}  >> $TS_OUTPUT
@@ -102,5 +113,6 @@ echo -e "${FDISK_CMD_BSD_LIST_TYPES}" | \
        $TS_CMD_FDISK ${TEST_IMAGE_NAME} | \
        sed 's/Reading .*//g; s/Welcome to fdisk .*//' >> $TS_OUTPUT 2>&1
 
+fdisk_bsd_byte_order_clean
 ts_fdisk_clean ${TEST_IMAGE_NAME}
 ts_finalize