summaryrefslogtreecommitdiffstats
path: root/tests/expected/sfdisk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
commit378c18e5f024ac5a8aef4cb40d7c9aa9633d144c (patch)
tree44dfb6ca500d32cabd450649b322a42e70a30683 /tests/expected/sfdisk
parentInitial commit. (diff)
downloadutil-linux-upstream.tar.xz
util-linux-upstream.zip
Adding upstream version 2.38.1.upstream/2.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/expected/sfdisk')
-rw-r--r--tests/expected/sfdisk/dos-activate20
-rw-r--r--tests/expected/sfdisk/dos-default-vs-gap124
-rw-r--r--tests/expected/sfdisk/dos-default-vs-gap230
-rw-r--r--tests/expected/sfdisk/dos-dump-gaps27
-rw-r--r--tests/expected/sfdisk/dos-dump-old26
-rw-r--r--tests/expected/sfdisk/dos-explicit-size36
-rw-r--r--tests/expected/sfdisk/dos-explicit-size.err7
-rw-r--r--tests/expected/sfdisk/dos-read-dump35
-rw-r--r--tests/expected/sfdisk/dos-read-dump-case24
-rw-r--r--tests/expected/sfdisk/dos-read-dump.err2
-rw-r--r--tests/expected/sfdisk/dos-reduce-empty-extended26
-rw-r--r--tests/expected/sfdisk/dos-resize24
-rw-r--r--tests/expected/sfdisk/dos-resize-empty-extended26
-rw-r--r--tests/expected/sfdisk/dos-resize-extended34
-rw-r--r--tests/expected/sfdisk/dos-resize-logical34
-rw-r--r--tests/expected/sfdisk/dos-simple-commas32
-rw-r--r--tests/expected/sfdisk/dos-simple-space26
-rw-r--r--tests/expected/sfdisk/dos-sizes-vs-gaps26
-rw-r--r--tests/expected/sfdisk/dos-write-dump12
-rw-r--r--tests/expected/sfdisk/dos-write-json43
-rw-r--r--tests/expected/sfdisk/dump0
-rw-r--r--tests/expected/sfdisk/dump-current48
-rw-r--r--tests/expected/sfdisk/dump-v2.3247
-rw-r--r--tests/expected/sfdisk/dump-v2.3548
-rw-r--r--tests/expected/sfdisk/gpt-all-defaults32
-rw-r--r--tests/expected/sfdisk/gpt-attrs102
-rw-r--r--tests/expected/sfdisk/gpt-attrs-broken-guid0
-rw-r--r--tests/expected/sfdisk/gpt-attrs-broken-guid.err2
-rw-r--r--tests/expected/sfdisk/gpt-attrs-broken-nosep0
-rw-r--r--tests/expected/sfdisk/gpt-attrs-broken-nosep.err2
-rw-r--r--tests/expected/sfdisk/gpt-attrs-guid102
-rw-r--r--tests/expected/sfdisk/gpt-attrs-guid.err0
-rw-r--r--tests/expected/sfdisk/gpt-attrs-space102
-rw-r--r--tests/expected/sfdisk/gpt-attrs-space.err0
-rw-r--r--tests/expected/sfdisk/gpt-attrs-unsupported0
-rw-r--r--tests/expected/sfdisk/gpt-attrs-unsupported.err2
-rw-r--r--tests/expected/sfdisk/gpt-attrs-with-typo102
-rw-r--r--tests/expected/sfdisk/gpt-attrs-with-typo.err0
-rw-r--r--tests/expected/sfdisk/gpt-attrs.err0
-rw-r--r--tests/expected/sfdisk/gpt-label6
-rw-r--r--tests/expected/sfdisk/gpt-list-pmbr10
-rw-r--r--tests/expected/sfdisk/gpt-list-pmbr.err1
-rw-r--r--tests/expected/sfdisk/gpt-read-dump44
-rw-r--r--tests/expected/sfdisk/gpt-reorder51
-rw-r--r--tests/expected/sfdisk/gpt-resize24
-rw-r--r--tests/expected/sfdisk/gpt-type5
-rw-r--r--tests/expected/sfdisk/gpt-uuid1
-rw-r--r--tests/expected/sfdisk/gpt-write-dump12
-rw-r--r--tests/expected/sfdisk/gpt-write-json39
-rw-r--r--tests/expected/sfdisk/movedata-down31
-rw-r--r--tests/expected/sfdisk/movedata-non-overlay31
-rw-r--r--tests/expected/sfdisk/movedata-up31
-rw-r--r--tests/expected/sfdisk/resize-dos-0-move-up-absolute26
-rw-r--r--tests/expected/sfdisk/resize-dos-1-move-down-absolute26
-rw-r--r--tests/expected/sfdisk/resize-dos-10-down-enlarge26
-rw-r--r--tests/expected/sfdisk/resize-dos-11-absolute-move-resize26
-rw-r--r--tests/expected/sfdisk/resize-dos-12-reduce-midle30
-rw-r--r--tests/expected/sfdisk/resize-dos-13-max-last30
-rw-r--r--tests/expected/sfdisk/resize-dos-2-move-up-relative26
-rw-r--r--tests/expected/sfdisk/resize-dos-3-move-down-relative26
-rw-r--r--tests/expected/sfdisk/resize-dos-4-enlarge-absolute26
-rw-r--r--tests/expected/sfdisk/resize-dos-5-reduce-absolute26
-rw-r--r--tests/expected/sfdisk/resize-dos-6-enlarge-relative26
-rw-r--r--tests/expected/sfdisk/resize-dos-7-reduce-relative26
-rw-r--r--tests/expected/sfdisk/resize-dos-8-enlarge-all26
-rw-r--r--tests/expected/sfdisk/resize-dos-9-up-preduce26
-rw-r--r--tests/expected/sfdisk/resize-dos-unsorted74
-rw-r--r--tests/expected/sfdisk/resize-gpt-0-move-up-absolute26
-rw-r--r--tests/expected/sfdisk/resize-gpt-1-move-down-absolute26
-rw-r--r--tests/expected/sfdisk/resize-gpt-10-down-enlarge26
-rw-r--r--tests/expected/sfdisk/resize-gpt-11-absolute-move-resize26
-rw-r--r--tests/expected/sfdisk/resize-gpt-12-reduce-midle30
-rw-r--r--tests/expected/sfdisk/resize-gpt-13-max-last30
-rw-r--r--tests/expected/sfdisk/resize-gpt-2-move-up-relative26
-rw-r--r--tests/expected/sfdisk/resize-gpt-3-move-down-relative26
-rw-r--r--tests/expected/sfdisk/resize-gpt-4-enlarge-absolute26
-rw-r--r--tests/expected/sfdisk/resize-gpt-5-reduce-absolute26
-rw-r--r--tests/expected/sfdisk/resize-gpt-6-enlarge-relative26
-rw-r--r--tests/expected/sfdisk/resize-gpt-7-reduce-relative26
-rw-r--r--tests/expected/sfdisk/resize-gpt-8-enlarge-all26
-rw-r--r--tests/expected/sfdisk/resize-gpt-9-up-preduce26
-rw-r--r--tests/expected/sfdisk/script-broken-115
-rw-r--r--tests/expected/sfdisk/script-broken-1.err1
-rw-r--r--tests/expected/sfdisk/script-broken-215
-rw-r--r--tests/expected/sfdisk/script-broken-2.err1
-rw-r--r--tests/expected/sfdisk/script-broken-315
-rw-r--r--tests/expected/sfdisk/script-broken-3.err1
-rw-r--r--tests/expected/sfdisk/script-broken-415
-rw-r--r--tests/expected/sfdisk/script-broken-4.err1
-rw-r--r--tests/expected/sfdisk/script-broken-515
-rw-r--r--tests/expected/sfdisk/script-broken-5.err1
-rw-r--r--tests/expected/sfdisk/script-quotes44
-rw-r--r--tests/expected/sfdisk/script-separator44
-rw-r--r--tests/expected/sfdisk/script-type-and-id44
-rw-r--r--tests/expected/sfdisk/wipe-fs-to-dos28
-rw-r--r--tests/expected/sfdisk/wipe-fs-to-dos.err2
-rw-r--r--tests/expected/sfdisk/wipe-gpt-to-dos51
-rw-r--r--tests/expected/sfdisk/wipe-gpt-to-dos-auto58
-rw-r--r--tests/expected/sfdisk/wipe-gpt-to-dos-auto.err0
-rw-r--r--tests/expected/sfdisk/wipe-gpt-to-dos.err0
-rw-r--r--tests/expected/sfdisk/wipe-partition59
-rw-r--r--tests/expected/sfdisk/wipe-partition.err1
-rw-r--r--tests/expected/sfdisk/wipe.err0
103 files changed, 2618 insertions, 0 deletions
diff --git a/tests/expected/sfdisk/dos-activate b/tests/expected/sfdisk/dos-activate
new file mode 100644
index 0000000..59f460d
--- /dev/null
+++ b/tests/expected/sfdisk/dos-activate
@@ -0,0 +1,20 @@
+The bootable flag on partition 1 is enabled now.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 8191 6144 3M 83 Linux
+<removed>2 8192 14335 6144 3M 82 Linux swap / Solaris
+<removed>3 14336 20479 6144 3M 83 Linux
+<removed>4 20480 102399 81920 40M 5 Extended
+<removed>5 22528 28671 6144 3M 83 Linux
+<removed>6 30720 102399 71680 35M 83 Linux
diff --git a/tests/expected/sfdisk/dos-default-vs-gap1 b/tests/expected/sfdisk/dos-default-vs-gap1
new file mode 100644
index 0000000..9539d22
--- /dev/null
+++ b/tests/expected/sfdisk/dos-default-vs-gap1
@@ -0,0 +1,24 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 6144 16383 10240 5M 83 Linux
+<removed>2 16384 28671 12288 6M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-default-vs-gap2 b/tests/expected/sfdisk/dos-default-vs-gap2
new file mode 100644
index 0000000..e76f704
--- /dev/null
+++ b/tests/expected/sfdisk/dos-default-vs-gap2
@@ -0,0 +1,30 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+All partitions used.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 8192 14335 6144 3M 83 Linux
+<removed>2 26624 36863 10240 5M 83 Linux
+<removed>3 14336 22527 8192 4M 83 Linux
+<removed>4 2048 6143 4096 2M 83 Linux
+
+Partition table entries are not in disk order.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-dump-gaps b/tests/expected/sfdisk/dos-dump-gaps
new file mode 100644
index 0000000..ee473e6
--- /dev/null
+++ b/tests/expected/sfdisk/dos-dump-gaps
@@ -0,0 +1,27 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Ignoring partition.
+<removed>3: Created a new partition <removed>.
+<removed>4: Ignoring partition.
+<removed>5: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 52046 49999 24.4M 83 Linux
+<removed>3 52048 102046 49999 24.4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-dump-old b/tests/expected/sfdisk/dos-dump-old
new file mode 100644
index 0000000..83f5bdd
--- /dev/null
+++ b/tests/expected/sfdisk/dos-dump-old
@@ -0,0 +1,26 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Ignoring partition.
+<removed>3: Ignoring partition.
+<removed>4: Ignoring partition.
+<removed>5: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 52046 49999 24.4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-explicit-size b/tests/expected/sfdisk/dos-explicit-size
new file mode 100644
index 0000000..20f421c
--- /dev/null
+++ b/tests/expected/sfdisk/dos-explicit-size
@@ -0,0 +1,36 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Created a new partition <removed>.
+<removed>6: Created a new partition <removed>.
+<removed>7: Created a new partition <removed>.
+<removed>8: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 1 1000 1000 500K 83 Linux
+<removed>2 1001 2000 1000 500K 82 Linux swap / Solaris
+<removed>3 2001 3000 1000 500K 83 Linux
+<removed>4 3001 102399 99399 48.5M 5 Extended
+<removed>5 3002 4001 1000 500K 83 Linux
+<removed>6 4003 5002 1000 500K 83 Linux
+<removed>7 5004 102399 97396 47.6M 83 Linux
+
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-explicit-size.err b/tests/expected/sfdisk/dos-explicit-size.err
new file mode 100644
index 0000000..975a4ee
--- /dev/null
+++ b/tests/expected/sfdisk/dos-explicit-size.err
@@ -0,0 +1,7 @@
+Partition 1 does not start on physical sector boundary.
+Partition 2 does not start on physical sector boundary.
+Partition 3 does not start on physical sector boundary.
+Partition 4 does not start on physical sector boundary.
+Partition 5 does not start on physical sector boundary.
+Partition 6 does not start on physical sector boundary.
+Partition 7 does not start on physical sector boundary.
diff --git a/tests/expected/sfdisk/dos-read-dump b/tests/expected/sfdisk/dos-read-dump
new file mode 100644
index 0000000..a0b0b77
--- /dev/null
+++ b/tests/expected/sfdisk/dos-read-dump
@@ -0,0 +1,35 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Created a new partition <removed>.
+<removed>6: Created a new partition <removed>.
+<removed>7: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 8191 6144 3M 83 Linux
+<removed>2 8192 14335 6144 3M 82 Linux swap / Solaris
+<removed>3 14336 20479 6144 3M 83 Linux
+<removed>4 20480 102399 81920 40M 5 Extended
+<removed>5 20481 26624 6144 3M 83 Linux
+<removed>6 26626 102399 75774 37M 83 Linux
+
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-read-dump-case b/tests/expected/sfdisk/dos-read-dump-case
new file mode 100644
index 0000000..3486cb2
--- /dev/null
+++ b/tests/expected/sfdisk/dos-read-dump-case
@@ -0,0 +1,24 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 8191 6144 3M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-read-dump.err b/tests/expected/sfdisk/dos-read-dump.err
new file mode 100644
index 0000000..48536f8
--- /dev/null
+++ b/tests/expected/sfdisk/dos-read-dump.err
@@ -0,0 +1,2 @@
+Partition 5 does not start on physical sector boundary.
+Partition 6 does not start on physical sector boundary.
diff --git a/tests/expected/sfdisk/dos-reduce-empty-extended b/tests/expected/sfdisk/dos-reduce-empty-extended
new file mode 100644
index 0000000..f37cdcf
--- /dev/null
+++ b/tests/expected/sfdisk/dos-reduce-empty-extended
@@ -0,0 +1,26 @@
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 14335 10240 5M 5 Extended
+
+<removed>2:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 10239 6144 3M 5 Extended
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-resize b/tests/expected/sfdisk/dos-resize
new file mode 100644
index 0000000..a39b940
--- /dev/null
+++ b/tests/expected/sfdisk/dos-resize
@@ -0,0 +1,24 @@
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 22527 20480 10M 82 Linux swap / Solaris
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 102399 100352 49M 82 Linux swap / Solaris
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-resize-empty-extended b/tests/expected/sfdisk/dos-resize-empty-extended
new file mode 100644
index 0000000..14cecbe
--- /dev/null
+++ b/tests/expected/sfdisk/dos-resize-empty-extended
@@ -0,0 +1,26 @@
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 8191 4096 2M 5 Extended
+
+<removed>2:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 102399 98304 48M 5 Extended
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-resize-extended b/tests/expected/sfdisk/dos-resize-extended
new file mode 100644
index 0000000..90dce82
--- /dev/null
+++ b/tests/expected/sfdisk/dos-resize-extended
@@ -0,0 +1,34 @@
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 18431 10240 5M 5 Extended
+<removed>5 10240 12287 2048 1M 83 Linux
+<removed>6 14336 16383 2048 1M 83 Linux
+
+<removed>4:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 102399 94208 46M 5 Extended
+<removed>5 10240 12287 2048 1M 83 Linux
+<removed>6 14336 16383 2048 1M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-resize-logical b/tests/expected/sfdisk/dos-resize-logical
new file mode 100644
index 0000000..e3b805a
--- /dev/null
+++ b/tests/expected/sfdisk/dos-resize-logical
@@ -0,0 +1,34 @@
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 28671 20480 10M 5 Extended
+<removed>5 10240 12287 2048 1M 83 Linux
+<removed>6 14336 16383 2048 1M 83 Linux
+
+<removed>6:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 28671 20480 10M 5 Extended
+<removed>5 10240 12287 2048 1M 83 Linux
+<removed>6 14336 28671 14336 7M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-simple-commas b/tests/expected/sfdisk/dos-simple-commas
new file mode 100644
index 0000000..b44be41
--- /dev/null
+++ b/tests/expected/sfdisk/dos-simple-commas
@@ -0,0 +1,32 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Created a new partition <removed>.
+<removed>6: Created a new partition <removed>.
+<removed>7: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 14335 6144 3M 82 Linux swap / Solaris
+<removed>3 14336 20479 6144 3M 83 Linux
+<removed>4 20480 102399 81920 40M 5 Extended
+<removed>5 22528 28671 6144 3M 83 Linux
+<removed>6 30720 102399 71680 35M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-simple-space b/tests/expected/sfdisk/dos-simple-space
new file mode 100644
index 0000000..1e22e9a
--- /dev/null
+++ b/tests/expected/sfdisk/dos-simple-space
@@ -0,0 +1,26 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 14335 6144 3M 82 Linux swap / Solaris
+<removed>3 14336 102399 88064 43M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-sizes-vs-gaps b/tests/expected/sfdisk/dos-sizes-vs-gaps
new file mode 100644
index 0000000..a3eb790
--- /dev/null
+++ b/tests/expected/sfdisk/dos-sizes-vs-gaps
@@ -0,0 +1,26 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 3070 1023 511.5K 83 Linux
+<removed>2 4096 8190 4095 2M 83 Linux
+<removed>3 8192 16382 8191 4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-write-dump b/tests/expected/sfdisk/dos-write-dump
new file mode 100644
index 0000000..660c932
--- /dev/null
+++ b/tests/expected/sfdisk/dos-write-dump
@@ -0,0 +1,12 @@
+label: dos
+label-id: 0x1ddc8a79
+device: <removed>
+unit: sectors
+sector-size: 512
+
+<removed>1 : start= 2048, size= 6144, type=83, bootable
+<removed>2 : start= 8192, size= 6144, type=82
+<removed>3 : start= 14336, size= 6144, type=83
+<removed>4 : start= 20480, size= 81920, type=5
+<removed>5 : start= 20481, size= 6144, type=83
+<removed>6 : start= 26626, size= 75774, type=83
diff --git a/tests/expected/sfdisk/dos-write-json b/tests/expected/sfdisk/dos-write-json
new file mode 100644
index 0000000..7a8ec4e
--- /dev/null
+++ b/tests/expected/sfdisk/dos-write-json
@@ -0,0 +1,43 @@
+{
+ "partitiontable": {
+ "label": "dos",
+ "id": "0x1ddc8a79",
+ "device": "<removed>",
+ "unit": "sectors",
+ "sectorsize": 512,
+ "partitions": [
+ {
+ "node": "<removed>1",
+ "start": 2048,
+ "size": 6144,
+ "type": "83",
+ "bootable": true
+ },{
+ "node": "<removed>2",
+ "start": 8192,
+ "size": 6144,
+ "type": "82"
+ },{
+ "node": "<removed>3",
+ "start": 14336,
+ "size": 6144,
+ "type": "83"
+ },{
+ "node": "<removed>4",
+ "start": 20480,
+ "size": 81920,
+ "type": "5"
+ },{
+ "node": "<removed>5",
+ "start": 20481,
+ "size": 6144,
+ "type": "83"
+ },{
+ "node": "<removed>6",
+ "start": 26626,
+ "size": 75774,
+ "type": "83"
+ }
+ ]
+ }
+}
diff --git a/tests/expected/sfdisk/dump b/tests/expected/sfdisk/dump
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/dump
diff --git a/tests/expected/sfdisk/dump-current b/tests/expected/sfdisk/dump-current
new file mode 100644
index 0000000..86b3f40
--- /dev/null
+++ b/tests/expected/sfdisk/dump-current
@@ -0,0 +1,48 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 45055 22528 11M Linux filesystem
+<removed>3 45056 69631 24576 12M Linux filesystem
+<removed>4 69632 204766 135135 66M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 22527 10M 28A432A3-8D63-3142-B9F5-68A2BF2BC60B Linux filesystem
+22528 45055 11M 6A7D17FC-7252-564A-9B68-5E2107999BF1 Linux filesystem
+45056 69631 12M 26C303E4-0321-3346-B9EF-BDD39BEA1166 Linux filesystem
+69632 204766 66M AF79D434-C8B3-2445-80FB-317AB157447C Linux filesystem
diff --git a/tests/expected/sfdisk/dump-v2.32 b/tests/expected/sfdisk/dump-v2.32
new file mode 100644
index 0000000..2c62295
--- /dev/null
+++ b/tests/expected/sfdisk/dump-v2.32
@@ -0,0 +1,47 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 45055 22528 11M Linux filesystem
+<removed>3 45056 69631 24576 12M Linux filesystem
+<removed>4 69632 204766 135135 66M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 22527 10M 28A432A3-8D63-3142-B9F5-68A2BF2BC60B Linux filesystem
+22528 45055 11M 6A7D17FC-7252-564A-9B68-5E2107999BF1 Linux filesystem
+45056 69631 12M 26C303E4-0321-3346-B9EF-BDD39BEA1166 Linux filesystem
+69632 204766 66M AF79D434-C8B3-2445-80FB-317AB157447C Linux filesystem
diff --git a/tests/expected/sfdisk/dump-v2.35 b/tests/expected/sfdisk/dump-v2.35
new file mode 100644
index 0000000..86b3f40
--- /dev/null
+++ b/tests/expected/sfdisk/dump-v2.35
@@ -0,0 +1,48 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 45055 22528 11M Linux filesystem
+<removed>3 45056 69631 24576 12M Linux filesystem
+<removed>4 69632 204766 135135 66M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 22527 10M 28A432A3-8D63-3142-B9F5-68A2BF2BC60B Linux filesystem
+22528 45055 11M 6A7D17FC-7252-564A-9B68-5E2107999BF1 Linux filesystem
+45056 69631 12M 26C303E4-0321-3346-B9EF-BDD39BEA1166 Linux filesystem
+69632 204766 66M AF79D434-C8B3-2445-80FB-317AB157447C Linux filesystem
diff --git a/tests/expected/sfdisk/gpt-all-defaults b/tests/expected/sfdisk/gpt-all-defaults
new file mode 100644
index 0000000..66868ed
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-all-defaults
@@ -0,0 +1,32 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Created a new partition <removed>.
+<removed>6: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 12287 10240 5M Linux filesystem
+<removed>2 12288 22527 10240 5M Linux filesystem
+<removed>3 22528 32767 10240 5M Linux swap
+<removed>4 32768 43007 10240 5M Linux root (x86-64)
+<removed>5 43008 100351 57344 28M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/gpt-attrs b/tests/expected/sfdisk/gpt-attrs
new file mode 100644
index 0000000..7cbfee4
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs
@@ -0,0 +1,102 @@
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+RequiredPartition NoBlockIOProtocol GUID:48,51
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help):
+Expert command (m for help):
+PMBR: offset = 0, size = 512 bytes.
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001c0 02 00 ee ff ff ff 01 00 00 00 ff 8f 01 00 00 00
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
+
+GPT Header: offset = 512, size = 512 bytes.
+00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+00000210 9b 58 15 32 00 00 00 00 01 00 00 00 00 00 00 00
+00000220 ff 8f 01 00 00 00 00 00 00 08 00 00 00 00 00 00
+00000230 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+00000240 8b 65 9e 76 45 41 21 8d 02 00 00 00 00 00 00 00
+00000250 80 00 00 00 80 00 00 00 25 86 e1 c0 00 00 00 00
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Entries: offset = 1024, size = 16384 bytes.
+00000400 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+00000410 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+00000420 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+00000430 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+00000440 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+00000450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000480 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000490 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+000004a0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+000004b0 03 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00
+000004c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000500 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+00000510 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+00000520 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000580 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+00000590 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+000005a0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+000005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000600 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000610 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+00000620 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+00000630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Entries: offset = 52411904, size = 16384 bytes.
+031fbe00 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+031fbe10 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+031fbe20 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+031fbe30 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+031fbe40 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+031fbe50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbe80 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fbe90 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+031fbea0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+031fbeb0 03 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00
+031fbec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf00 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+031fbf10 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+031fbf20 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+031fbf30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf80 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+031fbf90 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+031fbfa0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+031fbfb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fc000 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fc010 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+031fc020 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+031fc030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Header: offset = 52428288, size = 512 bytes.
+031ffe00 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+031ffe10 22 e2 97 b2 00 00 00 00 ff 8f 01 00 00 00 00 00
+031ffe20 01 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00
+031ffe30 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+031ffe40 8b 65 9e 76 45 41 21 8d df 8f 01 00 00 00 00 00
+031ffe50 80 00 00 00 80 00 00 00 25 86 e1 c0 00 00 00 00
+031ffe60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+Expert command (m for help):
diff --git a/tests/expected/sfdisk/gpt-attrs-broken-guid b/tests/expected/sfdisk/gpt-attrs-broken-guid
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-broken-guid
diff --git a/tests/expected/sfdisk/gpt-attrs-broken-guid.err b/tests/expected/sfdisk/gpt-attrs-broken-guid.err
new file mode 100644
index 0000000..3e57341
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-broken-guid.err
@@ -0,0 +1,2 @@
+unsupported GPT attribute bit 'GUID:NoBlockIOProtocol GUID:GUID:63 RequiredPartiton'
+sfdisk: <removed>: partition 2: failed to set partition attributes
diff --git a/tests/expected/sfdisk/gpt-attrs-broken-nosep b/tests/expected/sfdisk/gpt-attrs-broken-nosep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-broken-nosep
diff --git a/tests/expected/sfdisk/gpt-attrs-broken-nosep.err b/tests/expected/sfdisk/gpt-attrs-broken-nosep.err
new file mode 100644
index 0000000..946979c
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-broken-nosep.err
@@ -0,0 +1,2 @@
+failed to parse GPT attribute string 'NoBlockIOProtocolRequiredPartiton'
+sfdisk: <removed>: partition 2: failed to set partition attributes
diff --git a/tests/expected/sfdisk/gpt-attrs-guid b/tests/expected/sfdisk/gpt-attrs-guid
new file mode 100644
index 0000000..9797b49
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-guid
@@ -0,0 +1,102 @@
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+GUID:48,51,52,63
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help):
+Expert command (m for help):
+PMBR: offset = 0, size = 512 bytes.
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001c0 02 00 ee ff ff ff 01 00 00 00 ff 8f 01 00 00 00
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
+
+GPT Header: offset = 512, size = 512 bytes.
+00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+00000210 5a a7 90 27 00 00 00 00 01 00 00 00 00 00 00 00
+00000220 ff 8f 01 00 00 00 00 00 00 08 00 00 00 00 00 00
+00000230 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+00000240 8b 65 9e 76 45 41 21 8d 02 00 00 00 00 00 00 00
+00000250 80 00 00 00 80 00 00 00 af 59 5c 2a 00 00 00 00
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Entries: offset = 1024, size = 16384 bytes.
+00000400 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+00000410 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+00000420 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+00000430 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+00000440 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+00000450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000480 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000490 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+000004a0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+000004b0 00 00 00 00 00 00 19 80 00 00 00 00 00 00 00 00
+000004c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000500 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+00000510 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+00000520 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000580 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+00000590 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+000005a0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+000005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000600 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000610 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+00000620 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+00000630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Entries: offset = 52411904, size = 16384 bytes.
+031fbe00 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+031fbe10 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+031fbe20 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+031fbe30 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+031fbe40 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+031fbe50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbe80 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fbe90 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+031fbea0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+031fbeb0 00 00 00 00 00 00 19 80 00 00 00 00 00 00 00 00
+031fbec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf00 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+031fbf10 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+031fbf20 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+031fbf30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf80 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+031fbf90 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+031fbfa0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+031fbfb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fc000 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fc010 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+031fc020 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+031fc030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Header: offset = 52428288, size = 512 bytes.
+031ffe00 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+031ffe10 e3 1d 12 a7 00 00 00 00 ff 8f 01 00 00 00 00 00
+031ffe20 01 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00
+031ffe30 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+031ffe40 8b 65 9e 76 45 41 21 8d df 8f 01 00 00 00 00 00
+031ffe50 80 00 00 00 80 00 00 00 af 59 5c 2a 00 00 00 00
+031ffe60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+Expert command (m for help):
diff --git a/tests/expected/sfdisk/gpt-attrs-guid.err b/tests/expected/sfdisk/gpt-attrs-guid.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-guid.err
diff --git a/tests/expected/sfdisk/gpt-attrs-space b/tests/expected/sfdisk/gpt-attrs-space
new file mode 100644
index 0000000..7cbfee4
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-space
@@ -0,0 +1,102 @@
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+RequiredPartition NoBlockIOProtocol GUID:48,51
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help):
+Expert command (m for help):
+PMBR: offset = 0, size = 512 bytes.
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001c0 02 00 ee ff ff ff 01 00 00 00 ff 8f 01 00 00 00
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
+
+GPT Header: offset = 512, size = 512 bytes.
+00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+00000210 9b 58 15 32 00 00 00 00 01 00 00 00 00 00 00 00
+00000220 ff 8f 01 00 00 00 00 00 00 08 00 00 00 00 00 00
+00000230 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+00000240 8b 65 9e 76 45 41 21 8d 02 00 00 00 00 00 00 00
+00000250 80 00 00 00 80 00 00 00 25 86 e1 c0 00 00 00 00
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Entries: offset = 1024, size = 16384 bytes.
+00000400 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+00000410 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+00000420 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+00000430 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+00000440 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+00000450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000480 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000490 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+000004a0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+000004b0 03 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00
+000004c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000500 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+00000510 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+00000520 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000580 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+00000590 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+000005a0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+000005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000600 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000610 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+00000620 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+00000630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Entries: offset = 52411904, size = 16384 bytes.
+031fbe00 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+031fbe10 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+031fbe20 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+031fbe30 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+031fbe40 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+031fbe50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbe80 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fbe90 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+031fbea0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+031fbeb0 03 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00
+031fbec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf00 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+031fbf10 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+031fbf20 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+031fbf30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf80 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+031fbf90 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+031fbfa0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+031fbfb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fc000 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fc010 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+031fc020 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+031fc030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Header: offset = 52428288, size = 512 bytes.
+031ffe00 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+031ffe10 22 e2 97 b2 00 00 00 00 ff 8f 01 00 00 00 00 00
+031ffe20 01 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00
+031ffe30 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+031ffe40 8b 65 9e 76 45 41 21 8d df 8f 01 00 00 00 00 00
+031ffe50 80 00 00 00 80 00 00 00 25 86 e1 c0 00 00 00 00
+031ffe60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+Expert command (m for help):
diff --git a/tests/expected/sfdisk/gpt-attrs-space.err b/tests/expected/sfdisk/gpt-attrs-space.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-space.err
diff --git a/tests/expected/sfdisk/gpt-attrs-unsupported b/tests/expected/sfdisk/gpt-attrs-unsupported
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-unsupported
diff --git a/tests/expected/sfdisk/gpt-attrs-unsupported.err b/tests/expected/sfdisk/gpt-attrs-unsupported.err
new file mode 100644
index 0000000..8577358
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-unsupported.err
@@ -0,0 +1,2 @@
+unsupported GPT attribute bit 'FooBar 48 51'
+sfdisk: <removed>: partition 2: failed to set partition attributes
diff --git a/tests/expected/sfdisk/gpt-attrs-with-typo b/tests/expected/sfdisk/gpt-attrs-with-typo
new file mode 100644
index 0000000..7cbfee4
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-with-typo
@@ -0,0 +1,102 @@
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+RequiredPartition NoBlockIOProtocol GUID:48,51
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help):
+Expert command (m for help):
+PMBR: offset = 0, size = 512 bytes.
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001c0 02 00 ee ff ff ff 01 00 00 00 ff 8f 01 00 00 00
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
+
+GPT Header: offset = 512, size = 512 bytes.
+00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+00000210 9b 58 15 32 00 00 00 00 01 00 00 00 00 00 00 00
+00000220 ff 8f 01 00 00 00 00 00 00 08 00 00 00 00 00 00
+00000230 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+00000240 8b 65 9e 76 45 41 21 8d 02 00 00 00 00 00 00 00
+00000250 80 00 00 00 80 00 00 00 25 86 e1 c0 00 00 00 00
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Entries: offset = 1024, size = 16384 bytes.
+00000400 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+00000410 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+00000420 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+00000430 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+00000440 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+00000450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000480 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000490 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+000004a0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+000004b0 03 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00
+000004c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000500 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+00000510 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+00000520 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000580 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+00000590 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+000005a0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+000005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+00000600 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+00000610 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+00000620 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+00000630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Entries: offset = 52411904, size = 16384 bytes.
+031fbe00 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b
+031fbe10 7b 65 dc 91 b4 d7 53 46 a3 67 66 31 94 ff d4 32
+031fbe20 00 08 00 00 00 00 00 00 ff 2f 00 00 00 00 00 00
+031fbe30 00 00 00 00 00 00 00 00 45 00 46 00 49 00 20 00
+031fbe40 73 00 79 00 73 00 74 00 65 00 6d 00 00 00 00 00
+031fbe50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbe80 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fbe90 df 8a a0 ba 7e 32 77 41 89 53 98 da 1a 51 76 c4
+031fbea0 00 30 00 00 00 00 00 00 ff 57 00 00 00 00 00 00
+031fbeb0 03 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00
+031fbec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf00 6d fd 57 06 ab a4 c4 43 84 e5 09 33 c8 4b 4f 4f
+031fbf10 87 8a ad ce 1a ff cb 45 83 e5 99 b0 8d 0e bc 87
+031fbf20 00 58 00 00 00 00 00 00 ff 7f 00 00 00 00 00 00
+031fbf30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fbf80 e3 bc 68 4f cd e8 b1 4d 96 e7 fb ca f9 84 b7 09
+031fbf90 60 dc fc d4 5d 76 c3 4b bd 84 0d 0b 98 42 c6 db
+031fbfa0 00 80 00 00 00 00 00 00 ff a7 00 00 00 00 00 00
+031fbfb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+031fc000 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4
+031fc010 d7 5b 15 60 d8 bf 8c 4e b8 00 22 19 00 77 93 73
+031fc020 00 a8 00 00 00 00 00 00 ff 87 01 00 00 00 00 00
+031fc030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+GPT Backup Header: offset = 52428288, size = 512 bytes.
+031ffe00 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
+031ffe10 22 e2 97 b2 00 00 00 00 ff 8f 01 00 00 00 00 00
+031ffe20 01 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00
+031ffe30 de 8f 01 00 00 00 00 00 99 c3 81 b1 11 47 52 4c
+031ffe40 8b 65 9e 76 45 41 21 8d df 8f 01 00 00 00 00 00
+031ffe50 80 00 00 00 80 00 00 00 25 86 e1 c0 00 00 00 00
+031ffe60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+
+Expert command (m for help):
diff --git a/tests/expected/sfdisk/gpt-attrs-with-typo.err b/tests/expected/sfdisk/gpt-attrs-with-typo.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs-with-typo.err
diff --git a/tests/expected/sfdisk/gpt-attrs.err b/tests/expected/sfdisk/gpt-attrs.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-attrs.err
diff --git a/tests/expected/sfdisk/gpt-label b/tests/expected/sfdisk/gpt-label
new file mode 100644
index 0000000..34ee589
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-label
@@ -0,0 +1,6 @@
+Partition name changed from '' to 'EFI system'.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+EFI system
diff --git a/tests/expected/sfdisk/gpt-list-pmbr b/tests/expected/sfdisk/gpt-list-pmbr
new file mode 100644
index 0000000..72f5fff
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-list-pmbr
@@ -0,0 +1,10 @@
+Disk <removed>: 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 / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 1 102399 102399 50M ee GPT
+
diff --git a/tests/expected/sfdisk/gpt-list-pmbr.err b/tests/expected/sfdisk/gpt-list-pmbr.err
new file mode 100644
index 0000000..5d51390
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-list-pmbr.err
@@ -0,0 +1 @@
+Partition 1 does not start on physical sector boundary.
diff --git a/tests/expected/sfdisk/gpt-read-dump b/tests/expected/sfdisk/gpt-read-dump
new file mode 100644
index 0000000..a35f2d4
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-read-dump
@@ -0,0 +1,44 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 8191 6144 3M Linux root (x86)
+<removed>2 8192 14335 6144 3M Linux filesystem
+<removed>3 14336 20479 6144 3M Linux filesystem
+<removed>4 20480 102366 81887 40M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 8191 3M 4DD6948A-44F8-4E6C-8BDC-064F740704F8 Linux root (x86)
+ 8192 14335 3M 44B51DEF-5F04-465A-91AA-2889A62D8E49 Linux filesystem
+14336 20479 3M 643E1D0D-BC02-4CED-B83B-86121062858F Linux filesystem
+20480 102366 40M D2A29B0A-FDEE-40C3-9BAE-B9FA782C986C Linux filesystem GPT is the best
diff --git a/tests/expected/sfdisk/gpt-reorder b/tests/expected/sfdisk/gpt-reorder
new file mode 100644
index 0000000..184a8ec
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-reorder
@@ -0,0 +1,51 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 8192 14335 6144 3M Linux filesystem
+<removed>2 2048 8191 6144 3M Linux filesystem
+<removed>3 20480 102366 81887 40M Linux filesystem
+<removed>4 14336 20479 6144 3M Linux filesystem
+
+Partition table entries are not in disk order.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Partitions order fixed.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 8191 6144 3M Linux filesystem
+<removed>2 8192 14335 6144 3M Linux filesystem
+<removed>3 14336 20479 6144 3M Linux filesystem
+<removed>4 20480 102366 81887 40M Linux filesystem
diff --git a/tests/expected/sfdisk/gpt-resize b/tests/expected/sfdisk/gpt-resize
new file mode 100644
index 0000000..6e9d2e5
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-resize
@@ -0,0 +1,24 @@
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux swap
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 102366 100319 49M Linux swap
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/gpt-type b/tests/expected/sfdisk/gpt-type
new file mode 100644
index 0000000..396b75d
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-type
@@ -0,0 +1,5 @@
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+C12A7328-F81F-11D2-BA4B-00A0C93EC93B
diff --git a/tests/expected/sfdisk/gpt-uuid b/tests/expected/sfdisk/gpt-uuid
new file mode 100644
index 0000000..d3d11e8
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-uuid
@@ -0,0 +1 @@
+91DC657B-D7B4-4653-A367-663194FFD432
diff --git a/tests/expected/sfdisk/gpt-write-dump b/tests/expected/sfdisk/gpt-write-dump
new file mode 100644
index 0000000..2a00786
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-write-dump
@@ -0,0 +1,12 @@
+label: gpt
+label-id: 3B8559DB-33AF-43E9-BEFC-C331D829B539
+device: <removed>
+unit: sectors
+first-lba: 2048
+last-lba: 102366
+sector-size: 512
+
+<removed>1 : start= 2048, size= 6144, type=44479540-F297-41B2-9AF7-D131D5F0458A, uuid=4DD6948A-44F8-4E6C-8BDC-064F740704F8
+<removed>2 : start= 8192, size= 6144, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=44B51DEF-5F04-465A-91AA-2889A62D8E49
+<removed>3 : start= 14336, size= 6144, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=643E1D0D-BC02-4CED-B83B-86121062858F
+<removed>4 : start= 20480, size= 81887, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=D2A29B0A-FDEE-40C3-9BAE-B9FA782C986C, name="GPT is the best"
diff --git a/tests/expected/sfdisk/gpt-write-json b/tests/expected/sfdisk/gpt-write-json
new file mode 100644
index 0000000..19e2824
--- /dev/null
+++ b/tests/expected/sfdisk/gpt-write-json
@@ -0,0 +1,39 @@
+{
+ "partitiontable": {
+ "label": "gpt",
+ "id": "3B8559DB-33AF-43E9-BEFC-C331D829B539",
+ "device": "<removed>",
+ "unit": "sectors",
+ "firstlba": 2048,
+ "lastlba": 102366,
+ "sectorsize": 512,
+ "partitions": [
+ {
+ "node": "<removed>1",
+ "start": 2048,
+ "size": 6144,
+ "type": "44479540-F297-41B2-9AF7-D131D5F0458A",
+ "uuid": "4DD6948A-44F8-4E6C-8BDC-064F740704F8"
+ },{
+ "node": "<removed>2",
+ "start": 8192,
+ "size": 6144,
+ "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+ "uuid": "44B51DEF-5F04-465A-91AA-2889A62D8E49"
+ },{
+ "node": "<removed>3",
+ "start": 14336,
+ "size": 6144,
+ "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+ "uuid": "643E1D0D-BC02-4CED-B83B-86121062858F"
+ },{
+ "node": "<removed>4",
+ "start": 20480,
+ "size": 81887,
+ "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+ "uuid": "D2A29B0A-FDEE-40C3-9BAE-B9FA782C986C",
+ "name": "GPT is the best"
+ }
+ ]
+ }
+}
diff --git a/tests/expected/sfdisk/movedata-down b/tests/expected/sfdisk/movedata-down
new file mode 100644
index 0000000..af0f6e8
--- /dev/null
+++ b/tests/expected/sfdisk/movedata-down
@@ -0,0 +1,31 @@
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 3048 23527 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2548 23027 20480 10M 83 Linux
+
+Data move:
+ typescript file <removed>.
+ start sector: (from/to) 3048 / 2548
+ sectors: 20480
+ step size: 1048576 bytes
+
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/movedata-non-overlay b/tests/expected/sfdisk/movedata-non-overlay
new file mode 100644
index 0000000..753a9c3
--- /dev/null
+++ b/tests/expected/sfdisk/movedata-non-overlay
@@ -0,0 +1,31 @@
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2548 23027 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 63988 84467 20480 10M 83 Linux
+
+Data move:
+ typescript file <removed>.
+ start sector: (from/to) 2548 / 63988
+ sectors: 20480
+ step size: 1048576 bytes
+
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/movedata-up b/tests/expected/sfdisk/movedata-up
new file mode 100644
index 0000000..9de06db
--- /dev/null
+++ b/tests/expected/sfdisk/movedata-up
@@ -0,0 +1,31 @@
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 3048 23527 20480 10M 83 Linux
+
+Data move:
+ typescript file <removed>.
+ start sector: (from/to) 2048 / 3048
+ sectors: 20480
+ step size: 1048576 bytes
+
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-0-move-up-absolute b/tests/expected/sfdisk/resize-dos-0-move-up-absolute
new file mode 100644
index 0000000..e1c069f
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-0-move-up-absolute
@@ -0,0 +1,26 @@
+3000,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 3000 23479 20480 10M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-1-move-down-absolute b/tests/expected/sfdisk/resize-dos-1-move-down-absolute
new file mode 100644
index 0000000..da88635
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-1-move-down-absolute
@@ -0,0 +1,26 @@
+2048,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 3000 23479 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-10-down-enlarge b/tests/expected/sfdisk/resize-dos-10-down-enlarge
new file mode 100644
index 0000000..df392d8
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-10-down-enlarge
@@ -0,0 +1,26 @@
+-10M,+10M,,*
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 22528 204799 182272 89M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 204799 202752 99M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-11-absolute-move-resize b/tests/expected/sfdisk/resize-dos-11-absolute-move-resize
new file mode 100644
index 0000000..43e6837
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-11-absolute-move-resize
@@ -0,0 +1,26 @@
+2048,10M,L
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 204799 202752 99M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 22527 20480 10M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-12-reduce-midle b/tests/expected/sfdisk/resize-dos-12-reduce-midle
new file mode 100644
index 0000000..669fd45
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-12-reduce-midle
@@ -0,0 +1,30 @@
+,-5M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 22527 20480 10M 83 Linux
+<removed>2 22528 43007 20480 10M 83 Linux
+<removed>3 43008 63487 20480 10M 83 Linux
+
+<removed>2:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 22527 20480 10M 83 Linux
+<removed>2 22528 32767 10240 5M 83 Linux
+<removed>3 43008 63487 20480 10M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-13-max-last b/tests/expected/sfdisk/resize-dos-13-max-last
new file mode 100644
index 0000000..3664d88
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-13-max-last
@@ -0,0 +1,30 @@
+-5M,+
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 22527 20480 10M 83 Linux
+<removed>2 22528 32767 10240 5M 83 Linux
+<removed>3 43008 63487 20480 10M 83 Linux
+
+<removed>3:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 22527 20480 10M 83 Linux
+<removed>2 22528 32767 10240 5M 83 Linux
+<removed>3 32768 204799 172032 84M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-2-move-up-relative b/tests/expected/sfdisk/resize-dos-2-move-up-relative
new file mode 100644
index 0000000..75a95b1
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-2-move-up-relative
@@ -0,0 +1,26 @@
++1M,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 4096 24575 20480 10M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-3-move-down-relative b/tests/expected/sfdisk/resize-dos-3-move-down-relative
new file mode 100644
index 0000000..b3816e0
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-3-move-down-relative
@@ -0,0 +1,26 @@
+-1M,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 4096 24575 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-4-enlarge-absolute b/tests/expected/sfdisk/resize-dos-4-enlarge-absolute
new file mode 100644
index 0000000..0c18f9f
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-4-enlarge-absolute
@@ -0,0 +1,26 @@
+-,15M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 32767 30720 15M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-5-reduce-absolute b/tests/expected/sfdisk/resize-dos-5-reduce-absolute
new file mode 100644
index 0000000..557875d
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-5-reduce-absolute
@@ -0,0 +1,26 @@
+,5M,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 32767 30720 15M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 12287 10240 5M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-6-enlarge-relative b/tests/expected/sfdisk/resize-dos-6-enlarge-relative
new file mode 100644
index 0000000..528d025
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-6-enlarge-relative
@@ -0,0 +1,26 @@
+, +10M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 12287 10240 5M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 32767 30720 15M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-7-reduce-relative b/tests/expected/sfdisk/resize-dos-7-reduce-relative
new file mode 100644
index 0000000..6a6fa0c
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-7-reduce-relative
@@ -0,0 +1,26 @@
+, -10M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 32767 30720 15M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 12287 10240 5M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-8-enlarge-all b/tests/expected/sfdisk/resize-dos-8-enlarge-all
new file mode 100644
index 0000000..2f6b3fb
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-8-enlarge-all
@@ -0,0 +1,26 @@
+,+
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 12287 10240 5M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 204799 202752 99M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-9-up-preduce b/tests/expected/sfdisk/resize-dos-9-up-preduce
new file mode 100644
index 0000000..2ca6f3b
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-9-up-preduce
@@ -0,0 +1,26 @@
++10M,-10M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 204799 202752 99M 83 Linux
+
+<removed>1:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 22528 204799 182272 89M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-dos-unsorted b/tests/expected/sfdisk/resize-dos-unsorted
new file mode 100644
index 0000000..a16c326
--- /dev/null
+++ b/tests/expected/sfdisk/resize-dos-unsorted
@@ -0,0 +1,74 @@
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Created a new partition <removed>.
+<removed>6: Created a new partition <removed>.
+<removed>7: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 108543 102400 50M 5 Extended
+<removed>4 108544 110591 2048 1M 83 Linux
+<removed>5 8192 10239 2048 1M 83 Linux
+<removed>6 12288 108543 96256 47M 83 Linux
+
+Partition table entries are not in disk order.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 108543 102400 50M 5 Extended
+<removed>4 108544 110591 2048 1M 83 Linux
+<removed>5 8192 10239 2048 1M 83 Linux
+<removed>6 12288 108543 96256 47M 83 Linux
+
+Partition table entries are not in disk order.
+
+<removed>4:
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 108543 102400 50M 5 Extended
+<removed>4 108544 204799 96256 47M 83 Linux
+<removed>5 8192 10239 2048 1M 83 Linux
+<removed>6 12288 108543 96256 47M 83 Linux
+
+Partition table entries are not in disk order.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-0-move-up-absolute b/tests/expected/sfdisk/resize-gpt-0-move-up-absolute
new file mode 100644
index 0000000..230841d
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-0-move-up-absolute
@@ -0,0 +1,26 @@
+3000,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 3000 23479 20480 10M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-1-move-down-absolute b/tests/expected/sfdisk/resize-gpt-1-move-down-absolute
new file mode 100644
index 0000000..de2a871
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-1-move-down-absolute
@@ -0,0 +1,26 @@
+2048,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 3000 23479 20480 10M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-10-down-enlarge b/tests/expected/sfdisk/resize-gpt-10-down-enlarge
new file mode 100644
index 0000000..037d0ab
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-10-down-enlarge
@@ -0,0 +1,26 @@
+-10M,+10M,,*
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 22528 204766 182239 89M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 204766 202719 99M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-11-absolute-move-resize b/tests/expected/sfdisk/resize-gpt-11-absolute-move-resize
new file mode 100644
index 0000000..351e858
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-11-absolute-move-resize
@@ -0,0 +1,26 @@
+2048,10M,L
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 204766 202719 99M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-12-reduce-midle b/tests/expected/sfdisk/resize-gpt-12-reduce-midle
new file mode 100644
index 0000000..683cede
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-12-reduce-midle
@@ -0,0 +1,30 @@
+,-5M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 43007 20480 10M Linux filesystem
+<removed>3 43008 63487 20480 10M Linux filesystem
+
+<removed>2:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 32767 10240 5M Linux filesystem
+<removed>3 43008 63487 20480 10M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-13-max-last b/tests/expected/sfdisk/resize-gpt-13-max-last
new file mode 100644
index 0000000..b0483f7
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-13-max-last
@@ -0,0 +1,30 @@
+-5M,+
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 32767 10240 5M Linux filesystem
+<removed>3 43008 63487 20480 10M Linux filesystem
+
+<removed>3:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+<removed>2 22528 32767 10240 5M Linux filesystem
+<removed>3 32768 204766 171999 84M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-2-move-up-relative b/tests/expected/sfdisk/resize-gpt-2-move-up-relative
new file mode 100644
index 0000000..7669dab
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-2-move-up-relative
@@ -0,0 +1,26 @@
++1M,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 4096 24575 20480 10M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-3-move-down-relative b/tests/expected/sfdisk/resize-gpt-3-move-down-relative
new file mode 100644
index 0000000..c8aa63a
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-3-move-down-relative
@@ -0,0 +1,26 @@
+-1M,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 4096 24575 20480 10M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-4-enlarge-absolute b/tests/expected/sfdisk/resize-gpt-4-enlarge-absolute
new file mode 100644
index 0000000..832e112
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-4-enlarge-absolute
@@ -0,0 +1,26 @@
+-,15M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 22527 20480 10M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 32767 30720 15M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-5-reduce-absolute b/tests/expected/sfdisk/resize-gpt-5-reduce-absolute
new file mode 100644
index 0000000..b214183
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-5-reduce-absolute
@@ -0,0 +1,26 @@
+,5M,
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 32767 30720 15M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 12287 10240 5M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-6-enlarge-relative b/tests/expected/sfdisk/resize-gpt-6-enlarge-relative
new file mode 100644
index 0000000..a9090e2
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-6-enlarge-relative
@@ -0,0 +1,26 @@
+, +10M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 12287 10240 5M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 32767 30720 15M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-7-reduce-relative b/tests/expected/sfdisk/resize-gpt-7-reduce-relative
new file mode 100644
index 0000000..7e391cd
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-7-reduce-relative
@@ -0,0 +1,26 @@
+, -10M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 32767 30720 15M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 12287 10240 5M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-8-enlarge-all b/tests/expected/sfdisk/resize-gpt-8-enlarge-all
new file mode 100644
index 0000000..d0c4c5e
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-8-enlarge-all
@@ -0,0 +1,26 @@
+,+
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 12287 10240 5M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 204766 202719 99M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/resize-gpt-9-up-preduce b/tests/expected/sfdisk/resize-gpt-9-up-preduce
new file mode 100644
index 0000000..16d348a
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-9-up-preduce
@@ -0,0 +1,26 @@
++10M,-10M
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 204766 202719 99M Linux filesystem
+
+<removed>1:
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 22528 204766 182239 89M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/script-broken-1 b/tests/expected/sfdisk/script-broken-1
new file mode 100644
index 0000000..5da9777
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-1
@@ -0,0 +1,15 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>>
+New situation:
+Leaving.
+
diff --git a/tests/expected/sfdisk/script-broken-1.err b/tests/expected/sfdisk/script-broken-1.err
new file mode 100644
index 0000000..bee3b2e
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-1.err
@@ -0,0 +1 @@
+line 5: unsupported command
diff --git a/tests/expected/sfdisk/script-broken-2 b/tests/expected/sfdisk/script-broken-2
new file mode 100644
index 0000000..5da9777
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-2
@@ -0,0 +1,15 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>>
+New situation:
+Leaving.
+
diff --git a/tests/expected/sfdisk/script-broken-2.err b/tests/expected/sfdisk/script-broken-2.err
new file mode 100644
index 0000000..bee3b2e
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-2.err
@@ -0,0 +1 @@
+line 5: unsupported command
diff --git a/tests/expected/sfdisk/script-broken-3 b/tests/expected/sfdisk/script-broken-3
new file mode 100644
index 0000000..5da9777
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-3
@@ -0,0 +1,15 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>>
+New situation:
+Leaving.
+
diff --git a/tests/expected/sfdisk/script-broken-3.err b/tests/expected/sfdisk/script-broken-3.err
new file mode 100644
index 0000000..bee3b2e
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-3.err
@@ -0,0 +1 @@
+line 5: unsupported command
diff --git a/tests/expected/sfdisk/script-broken-4 b/tests/expected/sfdisk/script-broken-4
new file mode 100644
index 0000000..5da9777
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-4
@@ -0,0 +1,15 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>>
+New situation:
+Leaving.
+
diff --git a/tests/expected/sfdisk/script-broken-4.err b/tests/expected/sfdisk/script-broken-4.err
new file mode 100644
index 0000000..bee3b2e
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-4.err
@@ -0,0 +1 @@
+line 5: unsupported command
diff --git a/tests/expected/sfdisk/script-broken-5 b/tests/expected/sfdisk/script-broken-5
new file mode 100644
index 0000000..5da9777
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-5
@@ -0,0 +1,15 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>>
+New situation:
+Leaving.
+
diff --git a/tests/expected/sfdisk/script-broken-5.err b/tests/expected/sfdisk/script-broken-5.err
new file mode 100644
index 0000000..bee3b2e
--- /dev/null
+++ b/tests/expected/sfdisk/script-broken-5.err
@@ -0,0 +1 @@
+line 5: unsupported command
diff --git a/tests/expected/sfdisk/script-quotes b/tests/expected/sfdisk/script-quotes
new file mode 100644
index 0000000..5ae4d4f
--- /dev/null
+++ b/tests/expected/sfdisk/script-quotes
@@ -0,0 +1,44 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 8191 6144 3M Linux filesystem
+<removed>2 8192 14335 6144 3M Linux filesystem
+<removed>3 14336 20479 6144 3M Linux filesystem
+<removed>4 20480 26623 6144 3M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 8191 3M 4DD6948A-44F8-4E6C-8BDC-064F740704F8 Linux filesystem
+ 8192 14335 3M 44B51DEF-5F04-465A-91AA-2889A62D8E49 Linux filesystem
+14336 20479 3M 643E1D0D-BC02-4CED-B83B-86121062858F Linux filesystem
+20480 26623 3M D2A29B0A-FDEE-40C3-9BAE-B9FA782C986C Linux filesystem
diff --git a/tests/expected/sfdisk/script-separator b/tests/expected/sfdisk/script-separator
new file mode 100644
index 0000000..0ac5453
--- /dev/null
+++ b/tests/expected/sfdisk/script-separator
@@ -0,0 +1,44 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 8191 6144 3M Linux filesystem
+<removed>2 8192 14335 6144 3M Linux root (x86)
+<removed>3 14336 20479 6144 3M Linux filesystem
+<removed>4 20480 102366 81887 40M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 8191 3M 4DD6948A-44F8-4E6C-8BDC-064F740704F8 Linux filesystem
+ 8192 14335 3M 44B51DEF-5F04-465A-91AA-2889A62D8E49 Linux root (x86)
+14336 20479 3M 643E1D0D-BC02-4CED-B83B-86121062858F Linux filesystem
+20480 102366 40M D2A29B0A-FDEE-40C3-9BAE-B9FA782C986C Linux filesystem
diff --git a/tests/expected/sfdisk/script-type-and-id b/tests/expected/sfdisk/script-type-and-id
new file mode 100644
index 0000000..ee6dc55
--- /dev/null
+++ b/tests/expected/sfdisk/script-type-and-id
@@ -0,0 +1,44 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Script header accepted.
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+<removed>5: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 8191 6144 3M Linux root (x86)
+<removed>2 8192 14335 6144 3M Linux root (x86)
+<removed>3 14336 20479 6144 3M Linux root (x86)
+<removed>4 20480 102366 81887 40M Linux root (x86)
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Start End Size UUID Type Name
+ 2048 8191 3M 4DD6948A-44F8-4E6C-8BDC-064F740704F8 Linux root (x86)
+ 8192 14335 3M 44B51DEF-5F04-465A-91AA-2889A62D8E49 Linux root (x86)
+14336 20479 3M 643E1D0D-BC02-4CED-B83B-86121062858F Linux root (x86)
+20480 102366 40M D2A29B0A-FDEE-40C3-9BAE-B9FA782C986C Linux root (x86)
diff --git a/tests/expected/sfdisk/wipe-fs-to-dos b/tests/expected/sfdisk/wipe-fs-to-dos
new file mode 100644
index 0000000..8f97e25
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-fs-to-dos
@@ -0,0 +1,28 @@
+
+=====Create FS================================
+
+=====Create DOS================================
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 102399 100352 49M 83 Linux
+
+The partition table has been altered.
+
+=====Check content================================
+OFFSET TYPE
+0x1fe dos
diff --git a/tests/expected/sfdisk/wipe-fs-to-dos.err b/tests/expected/sfdisk/wipe-fs-to-dos.err
new file mode 100644
index 0000000..1a08900
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-fs-to-dos.err
@@ -0,0 +1,2 @@
+The device contains 'swap' signature and it may be removed by a write command. See sfdisk(8) man page and --wipe option for more details.
+The device contains 'swap' signature and it may be removed by a write command. See sfdisk(8) man page and --wipe option for more details.
diff --git a/tests/expected/sfdisk/wipe-gpt-to-dos b/tests/expected/sfdisk/wipe-gpt-to-dos
new file mode 100644
index 0000000..8b9b130
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-gpt-to-dos
@@ -0,0 +1,51 @@
+
+=====Create GPT================================
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 100351 98304 48M Linux filesystem
+
+The partition table has been altered.
+
+=====Create DOS================================
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 100351 98304 48M Linux filesystem
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 102399 100352 49M 83 Linux
+
+The partition table has been altered.
+
+=====Check content================================
+OFFSET TYPE
+0x1fe dos
diff --git a/tests/expected/sfdisk/wipe-gpt-to-dos-auto b/tests/expected/sfdisk/wipe-gpt-to-dos-auto
new file mode 100644
index 0000000..2047a61
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-gpt-to-dos-auto
@@ -0,0 +1,58 @@
+
+=====Create GPT================================
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Old situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 102399 100352 49M 83 Linux
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 100351 98304 48M Linux filesystem
+
+The partition table has been altered.
+
+=====Create DOS================================
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Old situation:
+
+Device Start End Sectors Size Type
+<removed>1 2048 100351 98304 48M Linux filesystem
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 102399 100352 49M 83 Linux
+
+The partition table has been altered.
+
+=====Check content================================
+OFFSET TYPE
+0x1fe dos
diff --git a/tests/expected/sfdisk/wipe-gpt-to-dos-auto.err b/tests/expected/sfdisk/wipe-gpt-to-dos-auto.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-gpt-to-dos-auto.err
diff --git a/tests/expected/sfdisk/wipe-gpt-to-dos.err b/tests/expected/sfdisk/wipe-gpt-to-dos.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-gpt-to-dos.err
diff --git a/tests/expected/sfdisk/wipe-partition b/tests/expected/sfdisk/wipe-partition
new file mode 100644
index 0000000..765a22e
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-partition
@@ -0,0 +1,59 @@
+
+=====Create GPT================================
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 100351 98304 48M Linux filesystem
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+=====Create FS in partition================================
+
+=====Wipe whole-disk device================================
+
+=====Create GPT (again)================================
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+The signature will be removed by a write command.
+<removed>2: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 100351 98304 48M Linux filesystem
+
+Filesystem/RAID signature on partition 1 will be wiped.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+=====Check content (disk)================================
+OFFSET TYPE
+0x200 gpt
+0x31ffe00 gpt
+0x1fe PMBR
+
+=====Check content (partition)================================
diff --git a/tests/expected/sfdisk/wipe-partition.err b/tests/expected/sfdisk/wipe-partition.err
new file mode 100644
index 0000000..bce8a4c
--- /dev/null
+++ b/tests/expected/sfdisk/wipe-partition.err
@@ -0,0 +1 @@
+Partition #1 contains a swap signature.
diff --git a/tests/expected/sfdisk/wipe.err b/tests/expected/sfdisk/wipe.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/sfdisk/wipe.err