summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKarel Zak2015-04-23 11:37:00 +0200
committerKarel Zak2015-04-23 11:37:00 +0200
commitfb966a7e1f656e9e5cefe131f37b57eaf63fdb05 (patch)
treea52c66333d56d0caa812db39fd337528da5ffc67 /tests
parentlibfdisk: (gpt) fix end sector calculation on resize (diff)
downloadkernel-qcow2-util-linux-fb966a7e1f656e9e5cefe131f37b57eaf63fdb05.tar.gz
kernel-qcow2-util-linux-fb966a7e1f656e9e5cefe131f37b57eaf63fdb05.tar.xz
kernel-qcow2-util-linux-fb966a7e1f656e9e5cefe131f37b57eaf63fdb05.zip
tests: add sfdisk resize tests for GPT
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/expected/sfdisk/resize-gpt-0-move-up-absolute25
-rw-r--r--tests/expected/sfdisk/resize-gpt-1-move-down-absolute25
-rw-r--r--tests/expected/sfdisk/resize-gpt-10-down-enlarge25
-rw-r--r--tests/expected/sfdisk/resize-gpt-11-absolute-move-resize25
-rw-r--r--tests/expected/sfdisk/resize-gpt-12-reduce-midle29
-rw-r--r--tests/expected/sfdisk/resize-gpt-13-max-last29
-rw-r--r--tests/expected/sfdisk/resize-gpt-2-move-up-relative25
-rw-r--r--tests/expected/sfdisk/resize-gpt-3-move-down-relative25
-rw-r--r--tests/expected/sfdisk/resize-gpt-4-enlarge-absolute25
-rw-r--r--tests/expected/sfdisk/resize-gpt-5-reduce-absolute25
-rw-r--r--tests/expected/sfdisk/resize-gpt-6-enlarge-relative25
-rw-r--r--tests/expected/sfdisk/resize-gpt-7-reduce-relative25
-rw-r--r--tests/expected/sfdisk/resize-gpt-8-enlarge-all25
-rw-r--r--tests/expected/sfdisk/resize-gpt-9-up-preduce25
-rwxr-xr-xtests/ts/sfdisk/resize2
15 files changed, 359 insertions, 1 deletions
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 000000000..2f8478759
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-0-move-up-absolute
@@ -0,0 +1,25 @@
+3000,
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..ad28d6fdd
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-1-move-down-absolute
@@ -0,0 +1,25 @@
+2048,
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..44b1fb7b7
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-10-down-enlarge
@@ -0,0 +1,25 @@
+-10M,+10M,,*
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..c4dd0cbce
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-11-absolute-move-resize
@@ -0,0 +1,25 @@
+2048,10M,L
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..fad398e8a
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-12-reduce-midle
@@ -0,0 +1,29 @@
+,-5M
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..bcbe729b6
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-13-max-last
@@ -0,0 +1,29 @@
+-5M,+
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..deaf77744
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-2-move-up-relative
@@ -0,0 +1,25 @@
++1M,
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..eb7b80b64
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-3-move-down-relative
@@ -0,0 +1,25 @@
+-1M,
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..2a7843e33
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-4-enlarge-absolute
@@ -0,0 +1,25 @@
+-,15M
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..453f1fe30
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-5-reduce-absolute
@@ -0,0 +1,25 @@
+,5M,
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..064f74d12
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-6-enlarge-relative
@@ -0,0 +1,25 @@
+, +10M
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..8bb65f15c
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-7-reduce-relative
@@ -0,0 +1,25 @@
+, -10M
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..85a5c701a
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-8-enlarge-all
@@ -0,0 +1,25 @@
+,+
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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 000000000..741f172fb
--- /dev/null
+++ b/tests/expected/sfdisk/resize-gpt-9-up-preduce
@@ -0,0 +1,25 @@
++10M,-10M
+
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 100 MiB, 104857600 bytes, 204800 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 32768 bytes
+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:
+
+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/ts/sfdisk/resize b/tests/ts/sfdisk/resize
index 7083e402a..f3cde75c0 100755
--- a/tests/ts/sfdisk/resize
+++ b/tests/ts/sfdisk/resize
@@ -118,7 +118,7 @@ function test_label_resize {
test_label_resize dos
# GPT
-#test_label_resize gpt
+test_label_resize gpt
rmmod scsi_debug
ts_finalize