[parted-devel] [PATCH 1/2] tests: Increase disk size for duplicate test

Brian C. Lane bcl at redhat.com
Tue Feb 9 19:17:09 GMT 2021


Increase it from 8MiB to 32MiB and start the first partition at 2048
sector boundary instead of 32 so that no matter the sector size it will
be aligned.
---
 tests/duplicate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/duplicate.c b/tests/duplicate.c
index 771faab..129875e 100644
--- a/tests/duplicate.c
+++ b/tests/duplicate.c
@@ -27,7 +27,7 @@ main (int argc, char **argv)
   /* Create a file.  */
   int fd = open (dev_name, O_CREAT|O_TRUNC|O_WRONLY, 0644);
   assert (0 <= fd);
-  off_t size = 8 * 1024 * 1024;
+  off_t size = 32 * 1024 * 1024;
   assert (ftruncate (fd, size) == 0);
   assert (close (fd) == 0);
 
@@ -47,7 +47,7 @@ main (int argc, char **argv)
   const PedFileSystemType *fs_type = ped_file_system_type_get ("ext2");
   assert (fs_type);
   PedPartitionType part_type = PED_PARTITION_NORMAL;
-  const PedGeometry *geometry = ped_geometry_new (dev, 34, 1024);
+  const PedGeometry *geometry = ped_geometry_new (dev, 2048, 1024);
   assert (geometry);
   PedPartition *part = ped_partition_new (disk, part_type, fs_type,
                                           geometry->start, geometry->end);
@@ -66,7 +66,7 @@ main (int argc, char **argv)
     ped_partition_set_flag (part, PED_PARTITION_LBA, 1);
 
   /* Add a 2nd partition with a name (when supported) */
-  geometry = ped_geometry_new (dev, 1500, 500);
+  geometry = ped_geometry_new (dev, 4096, 1024);
   assert (geometry);
   part = ped_partition_new (disk, part_type, fs_type,
                             geometry->start, geometry->end);
-- 
2.26.2




More information about the parted-devel mailing list