4 # This file is part of util-linux.
6 # This file is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This file is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
18 TS_TOPDIR
="${0%/*}/../.."
21 .
$TS_TOPDIR/functions.sh
24 ts_check_test_command
"$TS_CMD_SFDISK"
25 ts_check_test_command
"$TS_HELPER_MD5"
28 ts_check_prog
"mkfs.ext4"
30 # set global variable TS_DEVICE
31 ts_scsi_debug_init dev_size_mb
=100 sector_size
=512
34 echo ',10M,L' |
$TS_CMD_SFDISK --no-reread ${TS_DEVICE} &> /dev
/null
37 mkfs.ext4
${TS_DEVICE}1 &> /dev
/null
39 CHECKSUM
=$
("$TS_HELPER_MD5" < "${TS_DEVICE}1")
43 CHECK
=$
("$TS_HELPER_MD5" < "${dev}")
44 if [ "$CHECKSUM" != "$CHECK" ]; then
45 echo "Checksum does not match!" >> $TS_OUTPUT
50 echo '+1000,' |
$TS_CMD_SFDISK --no-reread --move-data=$TS_OUTPUT.log
-N1 ${TS_DEVICE} >> $TS_OUTPUT 2>&1
51 ts_fdisk_clean
$TS_DEVICE
53 checksum
${TS_DEVICE}1
58 ts_init_subtest
"down"
59 echo "-500," |
$TS_CMD_SFDISK --no-reread --move-data=$TS_OUTPUT.log
-N1 ${TS_DEVICE} >> $TS_OUTPUT 2>&1
60 ts_fdisk_clean
$TS_DEVICE
62 checksum
${TS_DEVICE}1
67 ts_init_subtest
"non-overlay"
68 echo "+30M," |
$TS_CMD_SFDISK --no-reread --move-data=$TS_OUTPUT.log
-N1 ${TS_DEVICE} >> $TS_OUTPUT 2>&1
69 ts_fdisk_clean
$TS_DEVICE
71 checksum
${TS_DEVICE}1