]> git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/fdisk/align-512-4K-63
Revert "tests: fixes fdisk/align-512-* tests"
[thirdparty/util-linux.git] / tests / ts / fdisk / align-512-4K-63
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 #
19 # Test alignment for 512/512 disk *with* topology -- aligned to optimal
20 # I/O size (32KiB)
21 #
22
23 TS_TOPDIR="${0%/*}/../.."
24 TS_DESC="align 512/4K +alignment_offset"
25
26 . $TS_TOPDIR/functions.sh
27 ts_init "$*"
28
29 ts_check_test_command "$TS_CMD_FDISK"
30
31 ts_skip_nonroot
32
33 # set global variable TS_DEVICE
34 ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3 lowest_aligned=7
35 DEVNAME=$(basename $TS_DEVICE)
36
37 ts_log "Create partitions"
38 $TS_CMD_FDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
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 w
69 q
70 EOF
71
72 udevadm settle
73 ts_log "Alignment offsets:"
74 cat /sys/block/${DEVNAME}/${DEVNAME}{1,2,3,4,5,6,7}/alignment_offset >> $TS_OUTPUT 2>> $TS_ERRLOG
75
76
77 ts_fdisk_clean $TS_DEVICE
78
79 ts_finalize