From: Karel Zak Date: Fri, 8 Aug 2014 10:35:20 +0000 (+0200) Subject: fdisk: update tests and clean up output X-Git-Tag: v2.26-rc1~541 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fdde144f0acc042fa1fc56db84f4dc50afde1a9;p=thirdparty%2Futil-linux.git fdisk: update tests and clean up output Signed-off-by: Karel Zak --- diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c index 0eeeda1160..fed7a5745e 100644 --- a/disk-utils/fdisk.c +++ b/disk-utils/fdisk.c @@ -567,17 +567,16 @@ void list_disklabel(struct fdisk_context *cxt) } } - itr = fdisk_new_iter(FDISK_ITER_FORWARD); - fputc('\n', stdout); + itr = fdisk_new_iter(FDISK_ITER_FORWARD); + while (itr && fdisk_table_next_partition(tb, itr, &pa) == 0) fdisk_warn_alignment(cxt, fdisk_partition_get_start(pa), fdisk_partition_get_partno(pa) + 1); - if (fdisk_table_wrong_order(tb)) { + if (fdisk_table_wrong_order(tb)) fdisk_info(cxt, _("Partition table entries are not in disk order.")); - } fdisk_unref_table(tb); fdisk_free_iter(itr); @@ -693,7 +692,6 @@ static void print_device_pt(struct fdisk_context *cxt, char *device, int warnme) if (fdisk_dev_has_disklabel(cxt)) list_disklabel(cxt); - fputc('\n', stdout); } static void print_all_devices_pt(struct fdisk_context *cxt) diff --git a/tests/expected/blkid/md-raid0-whole b/tests/expected/blkid/md-raid0-whole index 83fbff356c..a6ab1ae8ac 100644 --- a/tests/expected/blkid/md-raid0-whole +++ b/tests/expected/blkid/md-raid0-whole @@ -32,6 +32,7 @@ Device Boot Start End Sectors Size Id Type p1 2048 22527 20480 10M 83 Linux p2 22528 204543 182016 88.9M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/blkid/md-raid1-part b/tests/expected/blkid/md-raid1-part index 8f73a694e7..db8becfed8 100644 --- a/tests/expected/blkid/md-raid1-part +++ b/tests/expected/blkid/md-raid1-part @@ -30,6 +30,7 @@ Device Boot Start End Sectors Size Id Type 1 2048 53247 51200 25M 83 Linux 2 53248 104447 51200 25M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/blkid/md-raid1-whole b/tests/expected/blkid/md-raid1-whole index 6f93f54de3..5ac5b01d67 100644 --- a/tests/expected/blkid/md-raid1-whole +++ b/tests/expected/blkid/md-raid1-whole @@ -32,6 +32,7 @@ Device Boot Start End Sectors Size Id Type /dev/md8p1 2048 22527 20480 10M 83 Linux /dev/md8p2 22528 43007 20480 10M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/fdisk/align-512-4K b/tests/expected/fdisk/align-512-4K index 49f93751df..261f16912b 100644 --- a/tests/expected/fdisk/align-512-4K +++ b/tests/expected/fdisk/align-512-4K @@ -64,6 +64,7 @@ Device Boot Start End Sectors Size Id Type 6 77824 88063 10240 5M 83 Linux 7 90112 102399 12288 6M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/fdisk/align-512-4K-63 b/tests/expected/fdisk/align-512-4K-63 index 6e44cfe2bb..ee58b3a2a0 100644 --- a/tests/expected/fdisk/align-512-4K-63 +++ b/tests/expected/fdisk/align-512-4K-63 @@ -65,6 +65,7 @@ Device Boot Start End Sectors Size Id Type 6 75775 86014 10240 5M 83 Linux 7 88063 102399 14337 7M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/fdisk/align-512-4K-md b/tests/expected/fdisk/align-512-4K-md index 317865a86c..87777f7742 100644 --- a/tests/expected/fdisk/align-512-4K-md +++ b/tests/expected/fdisk/align-512-4K-md @@ -30,6 +30,7 @@ Device Boot Start End Sectors Size Id Type 1 2048 43007 40960 20M 83 Linux 2 43008 102399 59392 29M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. @@ -69,6 +70,7 @@ Device Boot Start End Sectors Size Id Type p1 2048 22527 20480 10M 83 Linux p2 22528 43007 20480 10M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/fdisk/align-512-512 b/tests/expected/fdisk/align-512-512 index 27df570513..b4a0e568a7 100644 --- a/tests/expected/fdisk/align-512-512 +++ b/tests/expected/fdisk/align-512-512 @@ -64,4 +64,5 @@ Device Boot Start End Sectors Size Id Type p6 77824 88063 10240 5M 83 Linux p7 90112 102399 12288 6M 83 Linux + Command (m for help): diff --git a/tests/expected/fdisk/align-512-512-topology b/tests/expected/fdisk/align-512-512-topology index 8ae0c40572..7552656eec 100644 --- a/tests/expected/fdisk/align-512-512-topology +++ b/tests/expected/fdisk/align-512-512-topology @@ -64,6 +64,7 @@ Device Boot Start End Sectors Size Id Type 6 77824 88063 10240 5M 83 Linux 7 90112 102399 12288 6M 83 Linux + Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. diff --git a/tests/expected/fdisk/mbr-dos-mode b/tests/expected/fdisk/mbr-dos-mode index 5d84ea6f12..62c454a989 100644 --- a/tests/expected/fdisk/mbr-dos-mode +++ b/tests/expected/fdisk/mbr-dos-mode @@ -161,7 +161,6 @@ Device Boot Start End Cylinders Size Id Type 6 2 3 2 15.7M 83 Linux Partition table entries are not in disk order. - ------------------- Delete primary partition @@ -182,7 +181,6 @@ Device Boot Start End Cylinders Size Id Type 6 2 3 2 15.7M 83 Linux Partition table entries are not in disk order. - ------------------- Delete extended partition diff --git a/tests/expected/fdisk/mbr-nondos-mode b/tests/expected/fdisk/mbr-nondos-mode index f8af411d28..89396af46f 100644 --- a/tests/expected/fdisk/mbr-nondos-mode +++ b/tests/expected/fdisk/mbr-nondos-mode @@ -157,7 +157,6 @@ Device Boot Start End Sectors Size Id Type 6 14336 18431 4096 2M 83 Linux Partition table entries are not in disk order. - ------------------- Delete primary partition @@ -178,7 +177,6 @@ Device Boot Start End Sectors Size Id Type 6 14336 18431 4096 2M 83 Linux Partition table entries are not in disk order. - ------------------- Delete primary partition @@ -198,7 +196,6 @@ Device Boot Start End Sectors Size Id Type 6 14336 18431 4096 2M 83 Linux Partition table entries are not in disk order. - ------------------- Delete extended partition diff --git a/tests/expected/fdisk/mbr-sort b/tests/expected/fdisk/mbr-sort index fb897a3869..d7fb6aae74 100644 --- a/tests/expected/fdisk/mbr-sort +++ b/tests/expected/fdisk/mbr-sort @@ -6,7 +6,6 @@ Disk : 20 MiB, 20971520 bytes, 40960 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes - ------------------- Create primary partitions @@ -26,7 +25,6 @@ Device Boot Start End Sectors Size Id Type 4 8192 40959 32768 16M 5 Extended Partition table entries are not in disk order. - ------------------- Create logical partitions @@ -50,7 +48,6 @@ Device Boot Start End Sectors Size Id Type 8 10240 12287 2048 1M 83 Linux Partition table entries are not in disk order. - ------------------- Fix order. diff --git a/tests/expected/fdisk/oddinput b/tests/expected/fdisk/oddinput index a1dbdb6e06..7a91f8d2fe 100644 --- a/tests/expected/fdisk/oddinput +++ b/tests/expected/fdisk/oddinput @@ -7,7 +7,6 @@ Geometry: 255 heads, 63 sectors/track, 1 cylinders Units: cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes - Nonexistant file fdisk: cannot open _a_file_that_does_not_exist_: No such file or directory Too small file