Debian Codegraph @

tests/ts/fdisk/align-512-512

raw
1 #!/bin/bash
2
3 #
4 # This file is part of util-linux.
5 #
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.
10 #
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.
15 #
16
17 #
18 # Test default 1MiB (2048 sectors) alignment for 512/512 disk *without*
19 # topology.
20 #
21
22 TS_TOPDIR="${0%/*}/../.."
23 TS_DESC="align 512/512"
24
25 . "$TS_TOPDIR"/functions.sh
26 ts_init "$*"
27
28 ts_check_test_command "$TS_CMD_FDISK"
29
30 ts_skip_nonroot
31 ts_check_losetup
32
33 ts_device_init 50
34 DEVICE=$TS_LODEV
35
36 ts_log "Create partitions"
37 $TS_CMD_FDISK --noauto-pt ${DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
38 o
39 n
40 p
41 1
42
43 +10M
44 n
45 p
46 2
47
48 +10M
49 n
50 p
51 3
52
53 +10M
54 n
55 e
56
57
58 n
59
60 +5M
61 n
62
63 +5M
64 n
65
66
67 p
68 q
69 EOF
70
71 ts_fdisk_clean $DEVICE
72
73 ts_finalize