]> git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/libfdisk/mkpart
tests: split stdout and stderr
[thirdparty/util-linux.git] / tests / ts / libfdisk / mkpart
1 #!/bin/bash
2 #
3 # This file is part of util-linux.
4 #
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.
9 #
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.
14 #
15 # Create partition in non-interactive mode.
16 #
17
18 TS_TOPDIR="${0%/*}/../.."
19 TS_DESC="mkpart"
20
21 . $TS_TOPDIR/functions.sh
22 ts_init "$*"
23
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"
28
29 TEST_IMAGE_NAME=$(ts_image_init 15)
30
31 ts_init_subtest "mbr"
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}
36 ts_finalize_subtest
37
38 $TS_CMD_WIPEFS --all --force ${TEST_IMAGE_NAME} &> /dev/null
39
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}
45 ts_finalize_subtest
46
47 $TS_CMD_WIPEFS --all --force ${TEST_IMAGE_NAME} &> /dev/null
48
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}
54 ts_finalize_subtest
55
56 $TS_CMD_WIPEFS --all --force ${TEST_IMAGE_NAME} &> /dev/null
57
58 ts_init_subtest "gpt"
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}
63 ts_finalize_subtest
64
65
66 ts_finalize