From e1fe1815da9f864286d3154514b5a4437af50902 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 18 Sep 2013 15:38:33 +0200 Subject: tests: refresh fdisk tests --- tests/expected/fdisk/align-512-4K | 88 +++++++------- tests/expected/fdisk/align-512-4K-63 | 88 +++++++------- tests/expected/fdisk/align-512-4K-md | 83 +++++++------ tests/expected/fdisk/align-512-512 | 79 +++++++------ tests/expected/fdisk/align-512-512-topology | 84 ++++++------- tests/expected/fdisk/bsd | 88 ++++++++------ tests/expected/fdisk/gpt | 102 ++++++++-------- tests/expected/fdisk/mbr-dos-mode | 169 +++++++++++++------------- tests/expected/fdisk/mbr-nondos-mode | 176 +++++++++++++++------------- tests/expected/fdisk/oddinput | 4 +- tests/functions.sh | 13 +- tests/ts/fdisk/align-512-4K-md | 1 + tests/ts/fdisk/align-512-512 | 3 +- tests/ts/fdisk/bsd | 10 +- tests/ts/fdisk/gpt | 7 +- tests/ts/fdisk/mbr-dos-mode | 56 ++++----- tests/ts/fdisk/mbr-nondos-mode | 29 ++--- 17 files changed, 560 insertions(+), 520 deletions(-) diff --git a/tests/expected/fdisk/align-512-4K b/tests/expected/fdisk/align-512-4K index e5a28f54a..7ad9512a0 100644 --- a/tests/expected/fdisk/align-512-4K +++ b/tests/expected/fdisk/align-512-4K @@ -1,79 +1,79 @@ Create partitions - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Device does not contain a recognized partition table - +Device does not contain a recognized partition table. -The device presents a logical sector size that is smaller than -the physical sector size. Aligning to a physical sector (or optimal -I/O) size boundary is recommended, or performance may be impacted. +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (0 primary, 0 extended, 4 free) e extended -Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 -Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Partition 1 of type Linux and of size 10 MiB is set +Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (1 primary, 0 extended, 3 free) e extended -Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Using default value 22528 -Last sector, +sectors or +size{K,M,G} (22528-102399, default 102399): Partition 2 of type Linux and of size 10 MiB is set +Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Last sector, +sectors or +size{K,M,G,T,P} (22528-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (2 primary, 0 extended, 2 free) e extended -Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Using default value 43008 -Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Partition 3 of type Linux and of size 10 MiB is set +Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Last sector, +sectors or +size{K,M,G,T,P} (43008-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (3 primary, 0 extended, 1 free) e extended -Select (default e): Selected partition 4 -First sector (63488-102399, default 63488): Using default value 63488 -Last sector, +sectors or +size{K,M,G} (63488-102399, default 102399): Using default value 102399 -Partition 4 of type Extended and of size 19 MiB is set +Select (default e): +Selected partition 4 +First sector (63488-102399, default 63488): Last sector, +sectors or +size{K,M,G,T,P} (63488-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 5 -First sector (65536-102399, default 65536): Using default value 65536 -Last sector, +sectors or +size{K,M,G} (65536-102399, default 102399): Partition 5 of type Linux and of size 5 MiB is set +First sector (65536-102399, default 65536): Last sector, +sectors or +size{K,M,G,T,P} (65536-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 6 -First sector (77824-102399, default 77824): Using default value 77824 -Last sector, +sectors or +size{K,M,G} (77824-102399, default 102399): Partition 6 of type Linux and of size 5 MiB is set +First sector (77824-102399, default 77824): Last sector, +sectors or +size{K,M,G,T,P} (77824-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 7 -First sector (90112-102399, default 90112): Using default value 90112 -Last sector, +sectors or +size{K,M,G} (90112-102399, default 102399): Using default value 102399 -Partition 7 of type Linux and of size 6 MiB is set +First sector (90112-102399, default 90112): Last sector, +sectors or +size{K,M,G,T,P} (90112-102399, default 102399): +Created a new . -Command (m for help): -Disk /dev/...: 52 MB, 52428800 bytes, 102400 sectors -Units = sectors of 1 * 512 = 512 bytes +Command (m for help): Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 32768 bytes Disk label type: dos +Disk identifier: +Device Boot Start End Blocks Id System +1 2048 22527 10240 83 Linux +2 22528 43007 10240 83 Linux +3 43008 63487 10240 83 Linux +4 63488 102399 19456 5 Extended +5 65536 75775 5120 83 Linux +6 77824 88063 5120 83 Linux +7 90112 102399 6144 83 Linux - Device Boot Start End Blocks Id System -/dev/...1 2048 22527 10240 83 Linux -/dev/...2 22528 43007 10240 83 Linux -/dev/...3 43008 63487 10240 83 Linux -/dev/...4 63488 102399 19456 5 Extended -/dev/...5 65536 75775 5120 83 Linux -/dev/...6 77824 88063 5120 83 Linux -/dev/...7 90112 102399 6144 83 Linux - -Command (m for help): The partition table has been altered! - +Command (m for help): +The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. + Alignment offsets: 0 0 diff --git a/tests/expected/fdisk/align-512-4K-63 b/tests/expected/fdisk/align-512-4K-63 index 7e236ce55..0165abe33 100644 --- a/tests/expected/fdisk/align-512-4K-63 +++ b/tests/expected/fdisk/align-512-4K-63 @@ -1,80 +1,80 @@ Create partitions - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Device does not contain a recognized partition table - +Device does not contain a recognized partition table. -The device presents a logical sector size that is smaller than -the physical sector size. Aligning to a physical sector (or optimal -I/O) size boundary is recommended, or performance may be impacted. +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (0 primary, 0 extended, 4 free) e extended -Select (default p): Partition number (1-4, default 1): First sector (7-102399, default 7): Using default value 7 -Last sector, +sectors or +size{K,M,G} (7-102399, default 102399): Partition 1 of type Linux and of size 10 MiB is set +Select (default p): Partition number (1-4, default 1): First sector (7-102399, default 7): Last sector, +sectors or +size{K,M,G,T,P} (7-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (1 primary, 0 extended, 3 free) e extended -Select (default p): Partition number (2-4, default 2): First sector (20487-102399, default 20487): Using default value 20487 -Last sector, +sectors or +size{K,M,G} (20487-102399, default 102399): Partition 2 of type Linux and of size 10 MiB is set +Select (default p): Partition number (2-4, default 2): First sector (20487-102399, default 20487): Last sector, +sectors or +size{K,M,G,T,P} (20487-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (2 primary, 0 extended, 2 free) e extended -Select (default p): Partition number (3,4, default 3): First sector (40967-102399, default 40967): Using default value 40967 -Last sector, +sectors or +size{K,M,G} (40967-102399, default 102399): Partition 3 of type Linux and of size 10 MiB is set +Select (default p): Partition number (3,4, default 3): First sector (40967-102399, default 40967): Last sector, +sectors or +size{K,M,G,T,P} (40967-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (3 primary, 0 extended, 1 free) e extended -Select (default e): Selected partition 4 -First sector (61447-102399, default 61447): Using default value 61447 -Last sector, +sectors or +size{K,M,G} (61447-102399, default 102399): Using default value 102399 -Partition 4 of type Extended and of size 20 MiB is set +Select (default e): +Selected partition 4 +First sector (61447-102399, default 61447): Last sector, +sectors or +size{K,M,G,T,P} (61447-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 5 -First sector (61454-102399, default 63487): Using default value 63487 -Last sector, +sectors or +size{K,M,G} (63487-102399, default 102399): Partition 5 of type Linux and of size 5 MiB is set +First sector (61454-102399, default 63487): Last sector, +sectors or +size{K,M,G,T,P} (63487-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 6 -First sector (61454-102399, default 75775): Using default value 75775 -Last sector, +sectors or +size{K,M,G} (75775-102399, default 102399): Partition 6 of type Linux and of size 5 MiB is set +First sector (61454-102399, default 75775): Last sector, +sectors or +size{K,M,G,T,P} (75775-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 7 -First sector (61454-102399, default 88063): Using default value 88063 -Last sector, +sectors or +size{K,M,G} (88063-102399, default 102399): Using default value 102399 -Partition 7 of type Linux and of size 7 MiB is set +First sector (61454-102399, default 88063): Last sector, +sectors or +size{K,M,G,T,P} (88063-102399, default 102399): +Created a new . -Command (m for help): -Disk /dev/...: 52 MB, 52428800 bytes, 102400 sectors -Units = sectors of 1 * 512 = 512 bytes +Command (m for help): Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 32768 bytes Alignment offset: 3584 bytes Disk label type: dos +Disk identifier: +Device Boot Start End Blocks Id System +1 7 20486 10240 83 Linux +2 20487 40966 10240 83 Linux +3 40967 61446 10240 83 Linux +4 61447 102399 20476+ 5 Extended +5 63487 73726 5120 83 Linux +6 75775 86014 5120 83 Linux +7 88063 102399 7168+ 83 Linux - Device Boot Start End Blocks Id System -/dev/...1 7 20486 10240 83 Linux -/dev/...2 20487 40966 10240 83 Linux -/dev/...3 40967 61446 10240 83 Linux -/dev/...4 61447 102399 20476+ 5 Extended -/dev/...5 63487 73726 5120 83 Linux -/dev/...6 75775 86014 5120 83 Linux -/dev/...7 88063 102399 7168+ 83 Linux - -Command (m for help): The partition table has been altered! - +Command (m for help): +The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. + Alignment offsets: 0 0 diff --git a/tests/expected/fdisk/align-512-4K-md b/tests/expected/fdisk/align-512-4K-md index dbbbc05e3..beb7f27ef 100644 --- a/tests/expected/fdisk/align-512-4K-md +++ b/tests/expected/fdisk/align-512-4K-md @@ -1,89 +1,86 @@ Create partitions - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Device does not contain a recognized partition table - +Device does not contain a recognized partition table. -The device presents a logical sector size that is smaller than -the physical sector size. Aligning to a physical sector (or optimal -I/O) size boundary is recommended, or performance may be impacted. +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (0 primary, 0 extended, 4 free) e extended -Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 -Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Partition 1 of type Linux and of size 20 MiB is set +Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (1 primary, 0 extended, 3 free) e extended -Select (default p): Partition number (2-4, default 2): First sector (43008-102399, default 43008): Using default value 43008 -Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Using default value 102399 -Partition 2 of type Linux and of size 29 MiB is set +Select (default p): Partition number (2-4, default 2): First sector (43008-102399, default 43008): Last sector, +sectors or +size{K,M,G,T,P} (43008-102399, default 102399): +Created a new . -Command (m for help): -Disk /dev/...: 52 MB, 52428800 bytes, 102400 sectors -Units = sectors of 1 * 512 = 512 bytes +Command (m for help): Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 32768 bytes Disk label type: dos +Disk identifier: +Device Boot Start End Blocks Id System +1 2048 43007 20480 83 Linux +2 43008 102399 29696 83 Linux - Device Boot Start End Blocks Id System -/dev/...1 2048 43007 20480 83 Linux -/dev/...2 43008 102399 29696 83 Linux - -Command (m for help): The partition table has been altered! - +Command (m for help): +The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. + Alignment offsets: 0 0 Create partitions (MD) - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Device does not contain a recognized partition table - +Device does not contain a recognized partition table. -The device presents a logical sector size that is smaller than -the physical sector size. Aligning to a physical sector (or optimal -I/O) size boundary is recommended, or performance may be impacted. +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (0 primary, 0 extended, 4 free) e extended -Select (default p): Partition number (1-4, default 1): First sector (2048-100095, default 2048): Using default value 2048 -Last sector, +sectors or +size{K,M,G} (2048-100095, default 100095): Partition 1 of type Linux and of size 10 MiB is set +Select (default p): Partition number (1-4, default 1): First sector (2048-100095, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-100095, default 100095): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (1 primary, 0 extended, 3 free) e extended -Select (default p): Partition number (2-4, default 2): First sector (22528-100095, default 22528): Using default value 22528 -Last sector, +sectors or +size{K,M,G} (22528-100095, default 100095): Partition 2 of type Linux and of size 10 MiB is set +Select (default p): Partition number (2-4, default 2): First sector (22528-100095, default 22528): Last sector, +sectors or +size{K,M,G,T,P} (22528-100095, default 100095): +Created a new . -Command (m for help): -Disk /dev/md8: 51 MB, 51249152 bytes, 100096 sectors -Units = sectors of 1 * 512 = 512 bytes +Command (m for help): Disk : 48.9 MiB, 51249152 bytes, 100096 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 65536 bytes / 131072 bytes Disk label type: dos +Disk identifier: +Device Boot Start End Blocks Id System +p1 2048 22527 10240 83 Linux +p2 22528 43007 10240 83 Linux - Device Boot Start End Blocks Id System -/dev/md8p1 2048 22527 10240 83 Linux -/dev/md8p2 22528 43007 10240 83 Linux - -Command (m for help): The partition table has been altered! - +Command (m for help): +The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. + Alignment offsets (MD): 0 0 diff --git a/tests/expected/fdisk/align-512-512 b/tests/expected/fdisk/align-512-512 index 018322f1d..a047582a5 100644 --- a/tests/expected/fdisk/align-512-512 +++ b/tests/expected/fdisk/align-512-512 @@ -1,69 +1,72 @@ Create partitions - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Device does not contain a recognized partition table +Device does not contain a recognized partition table. +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (0 primary, 0 extended, 4 free) e extended -Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 -Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Partition 1 of type Linux and of size 10 MiB is set +Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (1 primary, 0 extended, 3 free) e extended -Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Using default value 22528 -Last sector, +sectors or +size{K,M,G} (22528-102399, default 102399): Partition 2 of type Linux and of size 10 MiB is set +Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Last sector, +sectors or +size{K,M,G,T,P} (22528-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (2 primary, 0 extended, 2 free) e extended -Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Using default value 43008 -Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Partition 3 of type Linux and of size 10 MiB is set +Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Last sector, +sectors or +size{K,M,G,T,P} (43008-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (3 primary, 0 extended, 1 free) e extended -Select (default e): Selected partition 4 -First sector (63488-102399, default 63488): Using default value 63488 -Last sector, +sectors or +size{K,M,G} (63488-102399, default 102399): Using default value 102399 -Partition 4 of type Extended and of size 19 MiB is set +Select (default e): +Selected partition 4 +First sector (63488-102399, default 63488): Last sector, +sectors or +size{K,M,G,T,P} (63488-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 5 -First sector (65536-102399, default 65536): Using default value 65536 -Last sector, +sectors or +size{K,M,G} (65536-102399, default 102399): Partition 5 of type Linux and of size 5 MiB is set +First sector (65536-102399, default 65536): Last sector, +sectors or +size{K,M,G,T,P} (65536-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 6 -First sector (77824-102399, default 77824): Using default value 77824 -Last sector, +sectors or +size{K,M,G} (77824-102399, default 102399): Partition 6 of type Linux and of size 5 MiB is set +First sector (77824-102399, default 77824): Last sector, +sectors or +size{K,M,G,T,P} (77824-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 7 -First sector (90112-102399, default 90112): Using default value 90112 -Last sector, +sectors or +size{K,M,G} (90112-102399, default 102399): Using default value 102399 -Partition 7 of type Linux and of size 6 MiB is set +First sector (90112-102399, default 90112): Last sector, +sectors or +size{K,M,G,T,P} (90112-102399, default 102399): +Created a new . -Command (m for help): -Disk /dev/loop0: 52 MB, 52428800 bytes, 102400 sectors -Units = sectors of 1 * 512 = 512 bytes +Command (m for help): Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos +Disk identifier: - - Device Boot Start End Blocks Id System -/dev/loop0p1 2048 22527 10240 83 Linux -/dev/loop0p2 22528 43007 10240 83 Linux -/dev/loop0p3 43008 63487 10240 83 Linux -/dev/loop0p4 63488 102399 19456 5 Extended -/dev/loop0p5 65536 75775 5120 83 Linux -/dev/loop0p6 77824 88063 5120 83 Linux -/dev/loop0p7 90112 102399 6144 83 Linux +Device Boot Start End Blocks Id System +p1 2048 22527 10240 83 Linux +p2 22528 43007 10240 83 Linux +p3 43008 63487 10240 83 Linux +p4 63488 102399 19456 5 Extended +p5 65536 75775 5120 83 Linux +p6 77824 88063 5120 83 Linux +p7 90112 102399 6144 83 Linux Command (m for help): diff --git a/tests/expected/fdisk/align-512-512-topology b/tests/expected/fdisk/align-512-512-topology index b3d31146c..1cab4faf0 100644 --- a/tests/expected/fdisk/align-512-512-topology +++ b/tests/expected/fdisk/align-512-512-topology @@ -1,75 +1,79 @@ Create partitions - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Device does not contain a recognized partition table +Device does not contain a recognized partition table. +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (0 primary, 0 extended, 4 free) e extended -Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Using default value 2048 -Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399): Partition 1 of type Linux and of size 10 MiB is set +Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (1 primary, 0 extended, 3 free) e extended -Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Using default value 22528 -Last sector, +sectors or +size{K,M,G} (22528-102399, default 102399): Partition 2 of type Linux and of size 10 MiB is set +Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Last sector, +sectors or +size{K,M,G,T,P} (22528-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (2 primary, 0 extended, 2 free) e extended -Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Using default value 43008 -Last sector, +sectors or +size{K,M,G} (43008-102399, default 102399): Partition 3 of type Linux and of size 10 MiB is set +Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Last sector, +sectors or +size{K,M,G,T,P} (43008-102399, default 102399): +Created a new . -Command (m for help): Partition type: +Command (m for help): +Partition type: p primary (3 primary, 0 extended, 1 free) e extended -Select (default e): Selected partition 4 -First sector (63488-102399, default 63488): Using default value 63488 -Last sector, +sectors or +size{K,M,G} (63488-102399, default 102399): Using default value 102399 -Partition 4 of type Extended and of size 19 MiB is set +Select (default e): +Selected partition 4 +First sector (63488-102399, default 63488): Last sector, +sectors or +size{K,M,G,T,P} (63488-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 5 -First sector (65536-102399, default 65536): Using default value 65536 -Last sector, +sectors or +size{K,M,G} (65536-102399, default 102399): Partition 5 of type Linux and of size 5 MiB is set +First sector (65536-102399, default 65536): Last sector, +sectors or +size{K,M,G,T,P} (65536-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 6 -First sector (77824-102399, default 77824): Using default value 77824 -Last sector, +sectors or +size{K,M,G} (77824-102399, default 102399): Partition 6 of type Linux and of size 5 MiB is set +First sector (77824-102399, default 77824): Last sector, +sectors or +size{K,M,G,T,P} (77824-102399, default 102399): +Created a new . -Command (m for help): All primary partitions are in use +Command (m for help): All primary partitions are in use. Adding logical partition 7 -First sector (90112-102399, default 90112): Using default value 90112 -Last sector, +sectors or +size{K,M,G} (90112-102399, default 102399): Using default value 102399 -Partition 7 of type Linux and of size 6 MiB is set +First sector (90112-102399, default 90112): Last sector, +sectors or +size{K,M,G,T,P} (90112-102399, default 102399): +Created a new . -Command (m for help): -Disk /dev/...: 52 MB, 52428800 bytes, 102400 sectors -Units = sectors of 1 * 512 = 512 bytes +Command (m for help): Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 32768 bytes Disk label type: dos +Disk identifier: +Device Boot Start End Blocks Id System +1 2048 22527 10240 83 Linux +2 22528 43007 10240 83 Linux +3 43008 63487 10240 83 Linux +4 63488 102399 19456 5 Extended +5 65536 75775 5120 83 Linux +6 77824 88063 5120 83 Linux +7 90112 102399 6144 83 Linux - Device Boot Start End Blocks Id System -/dev/...1 2048 22527 10240 83 Linux -/dev/...2 22528 43007 10240 83 Linux -/dev/...3 43008 63487 10240 83 Linux -/dev/...4 63488 102399 19456 5 Extended -/dev/...5 65536 75775 5120 83 Linux -/dev/...6 77824 88063 5120 83 Linux -/dev/...7 90112 102399 6144 83 Linux - -Command (m for help): The partition table has been altered! - +Command (m for help): +The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. + Alignment offsets: 0 0 diff --git a/tests/expected/fdisk/bsd b/tests/expected/fdisk/bsd index 85ff3b63c..3502c7459 100644 --- a/tests/expected/fdisk/bsd +++ b/tests/expected/fdisk/bsd @@ -4,29 +4,30 @@ Create new DOS partition table 57e721e38d1266c2df055067c18f2cf9 bsd.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + - Device Boot Start End Blocks Id System ------------------- Create 1st primary partition ada64ace122978d00d1d1c0e5ee45d26 bsd.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 4095 1024 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 2048 4095 1024 83 Linux ------------------- Create 2st primary partition @@ -35,57 +36,74 @@ Set 2nd partition type 2d8e8dff51a88a045db233418dd73fbe bsd.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 4095 1024 83 Linux +2 4096 20479 8192 a5 FreeBSD - Device Boot Start End Blocks Id System -__ts_dev__1 2048 4095 1024 83 Linux -__ts_dev__2 4096 20479 8192 a5 FreeBSD ------------------- Create default BSD 2e1cee529cb59c9341afef0443f196a1 bsd.img ---layout---------- - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Command (m for help): +Command (m for help): Entering to nested BSD disk label -BSD disklabel command (m for help): -4 partitions: -# start end size fstype [fsize bsize cpg] - c: 4096 20479 16384 unused 0 0 - d: 0 16064 16065 unused 0 0 +Command (m for help): Disk 2: 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1 cylinders +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disk label type: bsd +partitions: 4 + +# Start End Size Type fsize bsize cpg +c 4096 20479 16384 unused 0 0 +d 0 16064 16065 unused 0 0 + +Command (m for help): +Leaving nested disk label. -BSD disklabel command (m for help): Command (m for help): ------------------- b5c121c2091b2ff26b880551feac7112 bsd.img ---layout---------- - +Welcome to fdisk . Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Command (m for help): +Command (m for help): Entering to nested BSD disk label + +Command (m for help): Disk 2: 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1 cylinders +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disk label type: bsd +partitions: 4 -BSD disklabel command (m for help): -4 partitions: -# start end size fstype [fsize bsize cpg] - a: 4096 6144 2049 4.2BSD 0 0 0 - c: 4096 20479 16384 unused 0 0 - d: 0 16064 16065 unused 0 0 +# Start End Size Type fsize bsize cpg +a 4096 6144 2049 4.2BSD 0 0 0 +c 4096 20479 16384 unused 0 0 +d 0 16064 16065 unused 0 0 + +Command (m for help): +Leaving nested disk label. -BSD disklabel command (m for help): Command (m for help): ------------------- @@ -95,13 +113,13 @@ Changes will remain in memory only, until you decide to write them. Be careful before using the write command. -Command (m for help): +Command (m for help): Entering to nested BSD disk label -BSD disklabel command (m for help): +Command (m for help): 0 unused 5 4.1BSD 9 4.4LFS d boot 1 swap 6 Eighth Edition a unknown e ADOS 2 Version 6 7 4.2BSD b HPFS f HFS 3 Version 7 8 MS-DOS c ISO-9660 10 AdvFS 4 System V -BSD disklabel command (m for help): \ No newline at end of file +Command (m for help): diff --git a/tests/expected/fdisk/gpt b/tests/expected/fdisk/gpt index b73d5c339..7cdf603b1 100644 --- a/tests/expected/fdisk/gpt +++ b/tests/expected/fdisk/gpt @@ -2,97 +2,101 @@ Initialize empty image Create new GPT partition table ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt +Disk identifier: -# Start End Size Type Name ------------------- Create partitions Change partition type by number ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt +Disk identifier: + +Device Start End Size Type +1 2048 4095 1M EFI System +2 4096 6143 1M Linux filesystem +3 6144 8191 1M Linux filesystem +4 8192 10239 1M Linux filesystem +5 10240 12287 1M Linux filesystem +6 12288 14335 1M Linux filesystem +7 14336 16383 1M Linux filesystem +8 16384 18431 1M Linux filesystem - -# Start End Size Type Name - 1 2048 4095 1M EFI System - 2 4096 6143 1M Linux filesyste - 3 6144 8191 1M Linux filesyste - 4 8192 10239 1M Linux filesyste - 5 10240 12287 1M Linux filesyste - 6 12288 14335 1M Linux filesyste - 7 14336 16383 1M Linux filesyste - 8 16384 18431 1M Linux filesyste ------------------- Change partition type by UUID ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt +Disk identifier: + +Device Start End Size Type +1 2048 4095 1M EFI System +2 4096 6143 1M Linux filesystem +3 6144 8191 1M Linux filesystem +4 8192 10239 1M Linux filesystem +5 10240 12287 1M Linux swap +6 12288 14335 1M Linux filesystem +7 14336 16383 1M Linux filesystem +8 16384 18431 1M Linux filesystem - -# Start End Size Type Name - 1 2048 4095 1M EFI System - 2 4096 6143 1M Linux filesyste - 3 6144 8191 1M Linux filesyste - 4 8192 10239 1M Linux filesyste - 5 10240 12287 1M Linux swap - 6 12288 14335 1M Linux filesyste - 7 14336 16383 1M Linux filesyste - 8 16384 18431 1M Linux filesyste ------------------- Delete partition ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt +Disk identifier: +Device Start End Size Type +1 2048 4095 1M EFI System +3 6144 8191 1M Linux filesystem +4 8192 10239 1M Linux filesystem +5 10240 12287 1M Linux swap +6 12288 14335 1M Linux filesystem +7 14336 16383 1M Linux filesystem +8 16384 18431 1M Linux filesystem -# Start End Size Type Name - 1 2048 4095 1M EFI System - 3 6144 8191 1M Linux filesyste - 4 8192 10239 1M Linux filesyste - 5 10240 12287 1M Linux swap - 6 12288 14335 1M Linux filesyste - 7 14336 16383 1M Linux filesyste - 8 16384 18431 1M Linux filesyste ------------------- Create again partition ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt +Disk identifier: + +Device Start End Size Type +1 2048 4095 1M EFI System +2 4096 6143 1M Linux filesystem +3 6144 8191 1M Linux filesystem +4 8192 10239 1M Linux filesystem +5 10240 12287 1M Linux swap +6 12288 14335 1M Linux filesystem +7 14336 16383 1M Linux filesystem +8 16384 18431 1M Linux filesystem - -# Start End Size Type Name - 1 2048 4095 1M EFI System - 2 4096 6143 1M Linux filesyste - 3 6144 8191 1M Linux filesyste - 4 8192 10239 1M Linux filesyste - 5 10240 12287 1M Linux swap - 6 12288 14335 1M Linux filesyste - 7 14336 16383 1M Linux filesyste - 8 16384 18431 1M Linux filesyste ------------------- diff --git a/tests/expected/fdisk/mbr-dos-mode b/tests/expected/fdisk/mbr-dos-mode index 3330303a1..27f863600 100644 --- a/tests/expected/fdisk/mbr-dos-mode +++ b/tests/expected/fdisk/mbr-dos-mode @@ -4,190 +4,199 @@ Create new DOS partition table 57e721e38d1266c2df055067c18f2cf9 mbr-dos-mode.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -255 heads, 63 sectors/track, 1 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + - Device Boot Start End Blocks Id System ------------------- Create primary partition ae4f9b12f4a768849f72ea36938c30c7 mbr-dos-mode.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -255 heads, 63 sectors/track, 1 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 1 1 8001 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 83 Linux ------------------- Set partition type 4a5dba818f9962a82a086d8b99b89a17 mbr-dos-mode.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -255 heads, 63 sectors/track, 1 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 1 1 8001 bf Solaris - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 bf Solaris ------------------- Set primary partition active c30e9c761b71cf95c67e758b93706ac5 mbr-dos-mode.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -255 heads, 63 sectors/track, 1 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 * 1 1 8001 bf Solaris - Device Boot Start End Blocks Id System -__ts_dev__1 * 1 1 8001 bf Solaris ------------------- Re-create primary partition ae4f9b12f4a768849f72ea36938c30c7 mbr-dos-mode.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -255 heads, 63 sectors/track, 1 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 1 1 8001 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 83 Linux ------------------- Create extended partition 76987a00b353687cd1dba3ddea9d66f9 mbr-dos-mode.img ---layout---------- -__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors -255 heads, 63 sectors/track, 1 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 10 MiB, 10485760 bytes, 20480 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 1 1 8001 83 Linux +2 2 12 88357+ 5 Extended - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 83 Linux -__ts_dev__2 2 12 88357+ 5 Extended ------------------- Create logical partitions a1cd6708e4a6d2e5f6bc9d5c0da0cf3b mbr-dos-mode.img ---layout---------- -__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors -255 heads, 63 sectors/track, 7 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 54.9 MiB, 57577472 bytes, 112456 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 - - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 83 Linux -__ts_dev__2 2 12 88357+ 5 Extended -__ts_dev__5 2 3 16033+ 83 Linux -__ts_dev__6 4 5 16033+ 83 Linux -__ts_dev__7 6 7 16033+ 83 Linux -__ts_dev__8 8 9 16033+ 83 Linux +Disk identifier: + +Device Boot Start End Blocks Id System +1 1 1 8001 83 Linux +2 2 12 88357+ 5 Extended +5 2 3 16033+ 83 Linux +6 4 5 16033+ 83 Linux +7 6 7 16033+ 83 Linux +8 8 9 16033+ 83 Linux + ------------------- Delete logical partitions 4c6937d529ace5661fb82efb9394154a mbr-dos-mode.img ---layout---------- -__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors -255 heads, 63 sectors/track, 7 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 54.9 MiB, 57577472 bytes, 112456 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 1 1 8001 83 Linux +2 2 12 88357+ 5 Extended +5 6 7 16033+ 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 83 Linux -__ts_dev__2 2 12 88357+ 5 Extended -__ts_dev__5 6 7 16033+ 83 Linux ------------------- Create another logical partition 9589eaaed698d2402945ab3e513c1eb4 mbr-dos-mode.img ---layout---------- -__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors -255 heads, 63 sectors/track, 7 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 54.9 MiB, 57577472 bytes, 112456 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: - Device Boot Start End Blocks Id System -__ts_dev__1 1 1 8001 83 Linux -__ts_dev__2 2 12 88357+ 5 Extended -__ts_dev__5 6 7 16033+ 83 Linux -__ts_dev__6 2 3 16033+ 83 Linux +Device Boot Start End Blocks Id System +1 1 1 8001 83 Linux +2 2 12 88357+ 5 Extended +5 6 7 16033+ 83 Linux +6 2 3 16033+ 83 Linux + +Partition table entries are not in disk order. -Partition table entries are not in disk order ------------------- Delete primary partition 1e6d646e5df66a2664cfbbb13fa9a08a mbr-dos-mode.img ---layout---------- -__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors -255 heads, 63 sectors/track, 7 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 54.9 MiB, 57577472 bytes, 112456 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +2 2 12 88357+ 5 Extended +5 6 7 16033+ 83 Linux +6 2 3 16033+ 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__2 2 12 88357+ 5 Extended -__ts_dev__5 6 7 16033+ 83 Linux -__ts_dev__6 2 3 16033+ 83 Linux +Partition table entries are not in disk order. -Partition table entries are not in disk order ------------------- Delete extended partition fc3cdb12326656d7996b09b6f76973e7 mbr-dos-mode.img ---layout---------- -__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors -255 heads, 63 sectors/track, 7 cylinders -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk : 54.9 MiB, 57577472 bytes, 112456 sectors +Geometry: 255 heads, 63 sectors/track, 1024 cylinders +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + - Device Boot Start End Blocks Id System ------------------- diff --git a/tests/expected/fdisk/mbr-nondos-mode b/tests/expected/fdisk/mbr-nondos-mode index 060008302..f8f7525bd 100644 --- a/tests/expected/fdisk/mbr-nondos-mode +++ b/tests/expected/fdisk/mbr-nondos-mode @@ -4,204 +4,214 @@ Create new DOS partition table 4e23561dcb81678bb1bd678722c7cbb7 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + - Device Boot Start End Blocks Id System ------------------- Create 1st primary partition e21e16b7452d82e2a2810a1de8c3db05 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux ------------------- Set primary partition active 47f024f3b406598a0159400af7382e2c mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 * 2048 8191 3072 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 * 2048 8191 3072 83 Linux ------------------- Re-create 1st primary partition a5543ee1e3d2cf79913a56bae893a0f0 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux ------------------- Create 2nd primary partition 9d31ee977e26e72ebce78e8e543cd4ce mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux +2 8192 12287 2048 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux -__ts_dev__2 8192 12287 2048 83 Linux ------------------- Create extended partition 9528631b198e44564f67f8ca97fa51b8 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux +2 8192 12287 2048 83 Linux +3 12288 40959 14336 5 Extended - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux -__ts_dev__2 8192 12287 2048 83 Linux -__ts_dev__3 12288 40959 14336 5 Extended ------------------- Create logical partitions db4406e7bc0773f234fd1db1b58b5997 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 - - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux -__ts_dev__2 8192 12287 2048 83 Linux -__ts_dev__3 12288 40959 14336 5 Extended -__ts_dev__5 14336 18431 2048 83 Linux -__ts_dev__6 20480 24575 2048 83 Linux -__ts_dev__7 26624 30719 2048 83 Linux -__ts_dev__8 32768 36863 2048 83 Linux +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux +2 8192 12287 2048 83 Linux +3 12288 40959 14336 5 Extended +5 14336 18431 2048 83 Linux +6 20480 24575 2048 83 Linux +7 26624 30719 2048 83 Linux +8 32768 36863 2048 83 Linux + ------------------- Delete logical partitions de85b8d74f52f307b9467ea4c33438cb mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux +2 8192 12287 2048 83 Linux +3 12288 40959 14336 5 Extended +5 26624 30719 2048 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux -__ts_dev__2 8192 12287 2048 83 Linux -__ts_dev__3 12288 40959 14336 5 Extended -__ts_dev__5 26624 30719 2048 83 Linux ------------------- Create another logical partition 28d0cbe795535ee025dc7a4781516965 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +1 2048 8191 3072 83 Linux +2 8192 12287 2048 83 Linux +3 12288 40959 14336 5 Extended +5 26624 30719 2048 83 Linux +6 14336 18431 2048 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__1 2048 8191 3072 83 Linux -__ts_dev__2 8192 12287 2048 83 Linux -__ts_dev__3 12288 40959 14336 5 Extended -__ts_dev__5 26624 30719 2048 83 Linux -__ts_dev__6 14336 18431 2048 83 Linux +Partition table entries are not in disk order. -Partition table entries are not in disk order ------------------- Delete primary partition 6f1b62718cf8d83602d51de8944cee51 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: - Device Boot Start End Blocks Id System -__ts_dev__2 8192 12287 2048 83 Linux -__ts_dev__3 12288 40959 14336 5 Extended -__ts_dev__5 26624 30719 2048 83 Linux -__ts_dev__6 14336 18431 2048 83 Linux +Device Boot Start End Blocks Id System +2 8192 12287 2048 83 Linux +3 12288 40959 14336 5 Extended +5 26624 30719 2048 83 Linux +6 14336 18431 2048 83 Linux + +Partition table entries are not in disk order. -Partition table entries are not in disk order ------------------- Delete primary partition 7b29a3cda33e990e8a7877b81988b933 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + +Device Boot Start End Blocks Id System +3 12288 40959 14336 5 Extended +5 26624 30719 2048 83 Linux +6 14336 18431 2048 83 Linux - Device Boot Start End Blocks Id System -__ts_dev__3 12288 40959 14336 5 Extended -__ts_dev__5 26624 30719 2048 83 Linux -__ts_dev__6 14336 18431 2048 83 Linux +Partition table entries are not in disk order. -Partition table entries are not in disk order ------------------- Delete extended partition e1ef48d3d42f4ebcfd5bf4baf5e370e9 mbr-nondos-mode.img ---layout---------- -__ts_dev__: 20 MB, 20971520 bytes, 40960 sectors -Units = sectors of 1 * 512 = 512 bytes +Disk : 20 MiB, 20971520 bytes, 40960 sectors +Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos -Disk identifier: 0x00000001 +Disk identifier: + - Device Boot Start End Blocks Id System ------------------- diff --git a/tests/expected/fdisk/oddinput b/tests/expected/fdisk/oddinput index 19bf365fd..355500a16 100644 --- a/tests/expected/fdisk/oddinput +++ b/tests/expected/fdisk/oddinput @@ -2,8 +2,8 @@ Initialize empty image f1c9645dbc14efddc7d8a322685f26eb oddinput.img Empty image listing -Disk testimage: 10 MB, 10485760 bytes, 20480 sectors -Units = cylinders of 16065 * 512 = 8225280 bytes +Disk testimage: 10 MiB, 10485760 bytes, 20480 sectors +Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes diff --git a/tests/functions.sh b/tests/functions.sh index 7d9688691..384368b13 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -470,16 +470,19 @@ s/# //; } function ts_fdisk_clean { - local DEVNAME=$(basename "$1") + local DEVNAME=$1 # remove non comparable parts of fdisk output if [ x"${DEVNAME}" != x"" ]; then - sed -i -e "s/\/dev\/${DEVNAME}/\/dev\/.../g" $TS_OUTPUT + sed -i -e "s:${DEVNAME}::g" $TS_OUTPUT fi - sed -i -e 's/Disk identifier:.*//g' \ - -e 's/Building a new.*//g' \ - -e 's/Welcome to fdisk.*//g' \ + sed -i -e 's/Disk identifier:.*/Disk identifier: /g' \ + -e 's/Created a new.*/Created a new ./g' \ + -e 's/^Device[[:blank:]]*Start/Device Start/g' \ + -e 's/^Device[[:blank:]]*Boot/Device Boot/g' \ + -e 's/^Device[[:blank:]]*Flag/Device Flag/g' \ + -e 's/Welcome to fdisk.*/Welcome to fdisk ./g' \ $TS_OUTPUT } diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md index 09947ff9e..ad5568a04 100755 --- a/tests/ts/fdisk/align-512-4K-md +++ b/tests/ts/fdisk/align-512-4K-md @@ -86,5 +86,6 @@ udevadm settle rmmod scsi_debug ts_fdisk_clean $DEVICE +ts_fdisk_clean $MD_DEVICE ts_finalize diff --git a/tests/ts/fdisk/align-512-512 b/tests/ts/fdisk/align-512-512 index 82a6268cf..03133a6d1 100755 --- a/tests/ts/fdisk/align-512-512 +++ b/tests/ts/fdisk/align-512-512 @@ -64,7 +64,6 @@ q EOF ts_device_deinit $DEVICE - -ts_fdisk_clean +ts_fdisk_clean $DEVICE ts_finalize diff --git a/tests/ts/fdisk/bsd b/tests/ts/fdisk/bsd index b9b2a0fea..288388d8e 100755 --- a/tests/ts/fdisk/bsd +++ b/tests/ts/fdisk/bsd @@ -39,17 +39,14 @@ FDISK_CMD_BSD_LIST_TYPES="b\nl\nq\n" # list supported PT types and quit function print_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT - $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} | \ - sed 's/^.*\.img/__ts_dev__/g; - s/^[[:blank:]]*Device Boot/ Device Boot/g' >> $TS_OUTPUT 2>&1 + $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT echo -ne "-------------------\n\n" >> $TS_OUTPUT } function print_bsd_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT - echo -e "${FDISK_CMD_BSD_LIST}" | $TS_CMD_FDISK ${TEST_IMAGE_NAME} | \ - sed 's/Reading .*//g; - s/Welcome to fdisk .*//' >> $TS_OUTPUT 2>&1 + echo -e "${FDISK_CMD_BSD_LIST}" | \ + $TS_CMD_FDISK ${TEST_IMAGE_NAME} >> $TS_OUTPUT echo -ne "-------------------\n\n" >> $TS_OUTPUT } @@ -103,4 +100,5 @@ echo -e "${FDISK_CMD_BSD_LIST_TYPES}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} | \ sed 's/Reading .*//g; s/Welcome to fdisk .*//' >> $TS_OUTPUT 2>&1 +ts_fdisk_clean ${TEST_IMAGE_NAME} ts_finalize diff --git a/tests/ts/fdisk/gpt b/tests/ts/fdisk/gpt index a0902ca9f..e725f6d54 100755 --- a/tests/ts/fdisk/gpt +++ b/tests/ts/fdisk/gpt @@ -32,13 +32,9 @@ FDISK_CMD_CHANGE_TYPE_BY_UUID="t\n5\n0657FD6D-A4AB-43C4-84E5-0933C84B4F4F\n" FDISK_CMD_DELETE_PART="d\n2\n" # delete 2nd partition FDISK_CMD_CREATE_PART="n\n2\n\n\n" # create 2nd partition -#set -x - function print_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT - $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} 2> /dev/null | \ - sed 's/^.*\.img/__ts_dev__/g; - s/^[[:blank:]]*Device Boot/ Device Boot/g' >> $TS_OUTPUT 2>&1 + $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT echo -ne "-------------------\n\n" >> $TS_OUTPUT } @@ -81,4 +77,5 @@ echo -e "${FDISK_CMD_CREATE_PART}${FDISK_CMD_WRITE_CLOSE}" \ print_layout +ts_fdisk_clean ${TEST_IMAGE_NAME} ts_finalize diff --git a/tests/ts/fdisk/mbr-dos-mode b/tests/ts/fdisk/mbr-dos-mode index 713ec905f..b16e95c13 100755 --- a/tests/ts/fdisk/mbr-dos-mode +++ b/tests/ts/fdisk/mbr-dos-mode @@ -22,8 +22,7 @@ TS_DESC="MBR - dos mode" . $TS_TOPDIR/functions.sh ts_init "$*" -# cmd to change number of cylinders to 1024 and changes system id to 0x1 -FDISK_CMD_INIT="x\nc\n1024\ni\n0x1\nr\n" +FDISK_CMD_INIT="x\ni\n0x1\nr\n" FDISK_CMD_WRITE_CLOSE="w\nq\n" FDISK_CMD_CREATE_DOSLABEL="o\n" #create dos label FDISK_CMD_CREATE_PRIMARY="n\np\n1\n\n+1M\n" # create primary partition 1 of size 1MB @@ -35,13 +34,11 @@ FDISK_CMD_DELETE_LOGICALS="d\n6\nd\n5\nd\n6\n" # delete middle, head, tail, last FDISK_CMD_DELETE_PRIMARY="d\n1\n" # delete first primary FDISK_CMD_DELETE_EXTENDED="d\n2\n" # delete second primary -#set -x +FDISK_OPTIONS="-C 1024 -c=dos -u=cylinders" function print_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT - $TS_CMD_FDISK -c=dos -u=cylinders -l ${TEST_IMAGE_NAME} | \ - sed 's/^.*\.img/__ts_dev__/g; - s/^[[:blank:]]*Device Boot/ Device Boot/g' >> $TS_OUTPUT 2>&1 + $TS_CMD_FDISK ${FDISK_OPTIONS} -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT echo -ne "-------------------\n\n" >> $TS_OUTPUT } @@ -53,83 +50,82 @@ ts_log "Initialize empty image" TEST_IMAGE_NAME=$(ts_image_init 10) ts_image_md5sum >> $TS_OUTPUT 2>&1 -# need to run init twice, to change system ID after new label, otherwise system -# ID will be random and will screw up md5's ts_log "Create new DOS partition table" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_INIT}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_INIT}${FDISK_CMD_WRITE_CLOSE}" \ + | $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create primary partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ + $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Set partition type" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CHANGE_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_CHANGE_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}" | \ + $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Set primary partition active" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \ + $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Re-create primary partition" -echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "d\n${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ + $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create extended partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \ - $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \ + $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create logical partitions" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ + | $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete logical partitions" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \ + | $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create another logical partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ + | $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete primary partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_DELETE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ + | $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete extended partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \ - | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null +echo -e "${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \ + | $TS_CMD_FDISK ${FDISK_OPTIONS} ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout +ts_fdisk_clean ${TEST_IMAGE_NAME} ts_finalize diff --git a/tests/ts/fdisk/mbr-nondos-mode b/tests/ts/fdisk/mbr-nondos-mode index 4df302d90..88a80e636 100755 --- a/tests/ts/fdisk/mbr-nondos-mode +++ b/tests/ts/fdisk/mbr-nondos-mode @@ -36,9 +36,7 @@ FDISK_CMD_DELETE_EXTENDED="d\n3\n" # delete second primary function print_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT - $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} | \ - sed 's/^.*\.img/__ts_dev__/g; - s/^[[:blank:]]*Device Boot/ Device Boot/g' >> $TS_OUTPUT 2>&1 + $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT echo -ne "-------------------\n\n" >> $TS_OUTPUT } @@ -58,80 +56,83 @@ ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create 1st primary partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ +echo -e "${FDISK_CMD_CREATE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Set primary partition active" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \ +echo -e "${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Re-create 1st primary partition" -echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ +echo -e "d\n${FDISK_CMD_CREATE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create 2nd primary partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_2PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ +echo -e "${FDISK_CMD_CREATE_2PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create extended partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \ +echo -e "${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Create logical partitions" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ +echo -e "${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete logical partitions" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \ +echo -e "${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout + ts_log "Create another logical partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ +echo -e "${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete primary partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ +echo -e "${FDISK_CMD_DELETE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete primary partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_2PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ +echo -e "${FDISK_CMD_DELETE_2PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout ts_log "Delete extended partition" -echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \ +echo -e "${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null ts_image_md5sum >> $TS_OUTPUT 2>&1 print_layout +ts_fdisk_clean ${TEST_IMAGE_NAME} + ts_finalize -- cgit v1.2.3-55-g7522