From: Karel Zak Date: Thu, 23 Apr 2015 09:37:00 +0000 (+0200) Subject: tests: add sfdisk resize tests for GPT X-Git-Tag: v2.27-rc1~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb966a7e1f656e9e5cefe131f37b57eaf63fdb05;p=thirdparty%2Futil-linux.git tests: add sfdisk resize tests for GPT Signed-off-by: Karel Zak --- 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 0000000000..2f8478759e --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..ad28d6fdd2 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 3000 23479 20480 10M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..44b1fb7b76 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 22528 204766 182239 89M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..c4dd0cbced --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 204766 202719 99M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..fad398e8a9 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem +2 22528 43007 20480 10M Linux filesystem +3 43008 63487 20480 10M Linux filesystem + +2: +New situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem +2 22528 32767 10240 5M Linux filesystem +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 0000000000..bcbe729b64 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem +2 22528 32767 10240 5M Linux filesystem +3 43008 63487 20480 10M Linux filesystem + +3: +New situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem +2 22528 32767 10240 5M Linux filesystem +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 0000000000..deaf777447 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..eb7b80b644 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 4096 24575 20480 10M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..2a7843e332 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 22527 20480 10M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..453f1fe30f --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 32767 30720 15M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..064f74d123 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 12287 10240 5M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..8bb65f15c0 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 32767 30720 15M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..85a5c701a9 --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 12287 10240 5M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 0000000000..741f172fbb --- /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 : 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: + +Old situation: + +Device Start End Sectors Size Type +1 2048 204766 202719 99M Linux filesystem + +1: +New situation: + +Device Start End Sectors Size Type +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 7083e402ad..f3cde75c08 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