]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/libfdisk/mkpart
3 # This file is part of util-linux.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This file is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # Create partition in non-interactive mode.
18 TS_TOPDIR
="${0%/*}/../.."
21 .
$TS_TOPDIR/functions.sh
24 TESTPROG
="$TS_HELPER_LIBFDISK_MKPART"
25 ts_check_test_command
"$TESTPROG"
26 ts_check_test_command
"$TS_CMD_SFDISK"
27 ts_check_test_command
"$TS_CMD_WIPEFS"
29 TEST_IMAGE_NAME
=$
(ts_image_init
15)
32 $TESTPROG --label mbr
--device ${TEST_IMAGE_NAME} \
33 1M
1M
1M
- >> $TS_OUTPUT 2>> $TS_ERRLOG
34 $TS_CMD_SFDISK --list ${TEST_IMAGE_NAME} >> $TS_OUTPUT 2>> $TS_ERRLOG
35 ts_fdisk_clean
${TEST_IMAGE_NAME}
38 $TS_CMD_WIPEFS --all --force ${TEST_IMAGE_NAME} &> /dev
/null
40 ts_init_subtest
"mbr-logic"
41 $TESTPROG --label mbr
--device ${TEST_IMAGE_NAME} \
42 1M
1M
1M
- 1M
1M
->> $TS_OUTPUT 2>> $TS_ERRLOG
43 $TS_CMD_SFDISK --list ${TEST_IMAGE_NAME} >> $TS_OUTPUT 2>> $TS_ERRLOG
44 ts_fdisk_clean
${TEST_IMAGE_NAME}
47 $TS_CMD_WIPEFS --all --force ${TEST_IMAGE_NAME} &> /dev
/null
49 ts_init_subtest
"mbr-nopartno"
50 $TESTPROG --nopartno --label mbr
--device ${TEST_IMAGE_NAME} \
51 1M
1M
1M
- 1M
1M
->> $TS_OUTPUT 2>> $TS_ERRLOG
52 $TS_CMD_SFDISK --list ${TEST_IMAGE_NAME} >> $TS_OUTPUT 2>> $TS_ERRLOG
53 ts_fdisk_clean
${TEST_IMAGE_NAME}
56 $TS_CMD_WIPEFS --all --force ${TEST_IMAGE_NAME} &> /dev
/null
59 $TESTPROG --label gpt
--device ${TEST_IMAGE_NAME} \
60 1M
1M
1M
1M
1M
1M
- >> $TS_OUTPUT 2>> $TS_ERRLOG
61 $TS_CMD_SFDISK --list ${TEST_IMAGE_NAME} >> $TS_OUTPUT 2>> $TS_ERRLOG
62 ts_fdisk_clean
${TEST_IMAGE_NAME}