diff options
author | Ruediger Meier | 2016-04-06 09:16:11 +0200 |
---|---|---|
committer | Karel Zak | 2016-04-06 13:46:34 +0200 |
commit | bedd7311636f1ee1cb22c1ac8415d5bb675ec1d1 (patch) | |
tree | 2ce5c48e4dbaaa24b9d35282c326191860e172c7 /tests/ts/fdisk | |
parent | tests: fix fdisk/bsd for hppa (diff) | |
download | kernel-qcow2-util-linux-bedd7311636f1ee1cb22c1ac8415d5bb675ec1d1.tar.gz kernel-qcow2-util-linux-bedd7311636f1ee1cb22c1ac8415d5bb675ec1d1.tar.xz kernel-qcow2-util-linux-bedd7311636f1ee1cb22c1ac8415d5bb675ec1d1.zip |
tests: remove deprecated md5sum based fdisk/bsd test
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/fdisk')
-rwxr-xr-x | tests/ts/fdisk/bsd | 6 | ||||
-rwxr-xr-x | tests/ts/fdisk/bsd-deprecated | 149 |
2 files changed, 3 insertions, 152 deletions
diff --git a/tests/ts/fdisk/bsd b/tests/ts/fdisk/bsd index 19e999b16..fa64e1aff 100755 --- a/tests/ts/fdisk/bsd +++ b/tests/ts/fdisk/bsd @@ -17,12 +17,13 @@ # TS_TOPDIR="${0%/*}/../.." -TS_DESC="nested BSD (new)" +TS_DESC="nested BSD" . $TS_TOPDIR/functions.sh ts_init "$*" ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_HEXDUMP" ts_check_test_command "$TS_HELPER_SYSINFO" FDISK_CMD_CREATE_DOSLABEL="o\n" # create dos label @@ -49,7 +50,7 @@ case $ARCH in # see include/pt-bsd.h *alpha* | *ppc* | *ia64* | *hppa* ) BSD_LABELSECTOR=0 - BSD_LABELOFFSET=64 + BSD_LABELOFFSET=64 ;; *) BSD_LABELSECTOR=1 @@ -72,7 +73,6 @@ echo "BYTE_ORDER=$BYTE_ORDER" >> $TS_OUTPUT echo >> $TS_OUTPUT TS_EXPECTED+="_${BSD_LABELSECTOR}_${BSD_LABELOFFSET}${BSD_EXTRA}.${BYTE_ORDER}" -#echo $TS_EXPECTED function print_layout { echo -ne "\n---layout----------\n" >> $TS_OUTPUT diff --git a/tests/ts/fdisk/bsd-deprecated b/tests/ts/fdisk/bsd-deprecated deleted file mode 100755 index 5e2cfa423..000000000 --- a/tests/ts/fdisk/bsd-deprecated +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# -# This file is part of util-linux. -# -# Copyright (C) 2013-2016 Karel Zak <kzak@redhat.com> -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This file is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# - -TS_TOPDIR="${0%/*}/../.." -TS_DESC="nested BSD" - -. $TS_TOPDIR/functions.sh -ts_init "$*" - -ts_check_test_command "$TS_CMD_FDISK" -ts_check_test_command "$TS_HELPER_SYSINFO" - -FDISK_CMD_CREATE_DOSLABEL="o\n" # create dos label -FDISK_CMD_SETID="x\ni\n0x1\nr\n" # set non-random ID -FDISK_CMD_WRITE_CLOSE="w\nq\n" # write to image -FDISK_CMD_CREATE_PRIMARY1="n\np\n1\n\n+1M\n" # 1st primary partition of size 1MiB -FDISK_CMD_CREATE_PRIMARY2="n\np\n2\n\n\n" # 2nd primary partition for whole of the disk -FDISK_CMD_CHANGE_PART2TYPE="t\n2\na5\n" # change partition type FreeBSD - -FDISK_CMD_BSD_CREATE="b\ny\n" # create nested BSD PT -FDISK_CMD_BSD_LIST="b\np\nr\nq\n" # list nested BSD PT and quit -FDISK_CMD_BSD_CREATE_PART="b\nn\na\n\n+1M\n" # add BSD partition 'a', size 1MiB -FDISK_CMD_BSD_PARTTYPE="b\nt\na\n7\n" # set partition 'a' to type 4.2BSD -FDISK_CMD_BSD_LIST_TYPES="b\nl\nq\n" # list supported PT types and quit - -#set -x - -# BSD disklabel depends on sector/offset and endianness. We convert the md5sums -# into the most common values (little endian, BSD_LABELSECTOR = 1, -# BSD_LABELOFFSET = 0) so that they can be easily compared to the expected -# ones. -BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) -function fdisk_bsd_offset_and_byte_order_clean -{ - # expected md5sums are from x86 systems - local md5_bsdimg1_LE_0_64="2e1cee529cb59c9341afef0443f196a1" - local md5_bsdimg2_LE_0_64="b5c121c2091b2ff26b880551feac7112" - - if [ $BYTE_ORDER = "BE" ] ; then - # BSD_LABELSECTOR = 0, BSD_LABELOFFSET = 64 - sed -i \ - -e "s/c2273b52976351db75596c47c10b0725/$md5_bsdimg1_LE_0_64/" \ - -e "s/9a234a5b99e37d2ce0d92b65437b93cd/$md5_bsdimg2_LE_0_64/" \ - "$TS_OUTPUT" - - # BSD_LABELSECTOR = 1, BSD_LABELOFFSET = 0 - sed -i \ - -e "s/e990c8a1c2106a4cd4b008f16d71aaa6/$md5_bsdimg1_LE_0_64/" \ - -e "s/187a48c26e83d146b866868addc93702/$md5_bsdimg2_LE_0_64/" \ - "$TS_OUTPUT" - else - # BSD_LABELSECTOR = 0, BSD_LABELOFFSET = 64 - sed -i \ - -e "s/6d760d7a8ef33b27cc6e27f1e8807d48/$md5_bsdimg1_LE_0_64/" \ - -e "s/3739c7959adb42693a69edb7a99914e8/$md5_bsdimg2_LE_0_64/" \ - "$TS_OUTPUT" - - # special case for alpha - if grep -q "78a922a80361cb73049bced72e0f8f1d" $TS_OUTPUT; then - sed -i \ - -e "s/78a922a80361cb73049bced72e0f8f1d/$md5_bsdimg1_LE_0_64/" \ - -e "s/fc2803672a0643ffe46da325629616fc/$md5_bsdimg2_LE_0_64/" \ - -e 's/\(3 *Version 7 *8 *\)ext2 /\1MS-DOS/' \ - "$TS_OUTPUT" - fi - fi -} - -function print_layout { - echo -ne "\n---layout----------\n" >> $TS_OUTPUT - $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT - echo -ne "-------------------\n\n" >> $TS_OUTPUT -} - -function print_bsd_layout { - echo -ne "\n---layout----------\n" >> $TS_OUTPUT - echo -e "${FDISK_CMD_BSD_LIST}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} >> $TS_OUTPUT - echo -ne "-------------------\n\n" >> $TS_OUTPUT -} - -ts_log "Initialize empty image" -TEST_IMAGE_NAME=$(ts_image_init 10) -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -ts_log "Create new DOS partition table" -echo -e "${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_SETID}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -print_layout - -ts_log "Create 1st primary partition" -echo -e "${FDISK_CMD_CREATE_PRIMARY1}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -print_layout - -ts_log "Create 2st primary partition" -echo -e "${FDISK_CMD_CREATE_PRIMARY2}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -ts_log "Set 2nd partition type" -echo -e "${FDISK_CMD_CHANGE_PART2TYPE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -print_layout - -ts_log "Create default BSD" -echo -e "${FDISK_CMD_BSD_CREATE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -print_bsd_layout - -echo -e "${FDISK_CMD_BSD_CREATE_PART}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null - -echo -e "${FDISK_CMD_BSD_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum >> $TS_OUTPUT 2>&1 - -print_bsd_layout - -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_offset_and_byte_order_clean -ts_fdisk_clean ${TEST_IMAGE_NAME} -ts_finalize |