From 8ffad75e5b610274a664a00f1f1186070b602e18 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 3 Feb 2016 16:53:17 +0000 Subject: [PATCH] tests: Increase the size of the /dev/sda and /dev/sdb test devices. Previously these were rather small - just 500 MB. This is too small to create a btrfs device on aarch64 (where page size may be 64K), and barely enough even on x86-64. This change makes both these devices 10 GB, and adjusts a few tests so they continue to pass. --- docs/guestfs-hacking.pod | 6 +++--- generator/actions.ml | 17 +++++++++++------ tests/c-api/tests-main.c | 6 +++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod index 32f901d65..42d7759ee 100644 --- a/docs/guestfs-hacking.pod +++ b/docs/guestfs-hacking.pod @@ -105,16 +105,16 @@ The test environment has 4 block devices: =over 4 -=item F 500MB +=item F 10 GB General block device for testing. -=item F 500MB +=item F 10 GB F is an ext2 filesystem used for testing filesystem write operations. -=item F 10MB +=item F 10 MB Used in a few tests where two block devices are needed. diff --git a/generator/actions.ml b/generator/actions.ml index 407808290..8cec6b257 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -4779,7 +4779,8 @@ C option of C." }; proc_nr = Some 62; tests = [ InitEmpty, Always, TestResult ( - [["blockdev_getsz"; "/dev/sda"]], "ret == 1024000"), [] + [["blockdev_getsz"; "/dev/sda"]], + "ret == INT64_C(10)*1024*1024*1024/512"), [] ]; shortdesc = "get total size of device in 512-byte sectors"; longdesc = "\ @@ -4798,7 +4799,8 @@ This uses the L command." }; proc_nr = Some 63; tests = [ InitEmpty, Always, TestResult ( - [["blockdev_getsize64"; "/dev/sda"]], "ret == UINT64_C (524288000)"), [] + [["blockdev_getsize64"; "/dev/sda"]], + "ret == INT64_C(10)*1024*1024*1024"), [] ]; shortdesc = "get total size of device in bytes"; longdesc = "\ @@ -7395,13 +7397,16 @@ and C" }; ["write"; "/new"; "new file contents"]; ["cat"; "/new"]], "new file contents"), []; InitEmpty, Always, TestRun ( - [["part_disk"; "/dev/sda"; "mbr"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; ["mkfs_b"; "vfat"; "32768"; "/dev/sda1"]]), []; InitEmpty, Always, TestLastFail ( - [["part_disk"; "/dev/sda"; "mbr"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; ["mkfs_b"; "vfat"; "32769"; "/dev/sda1"]]), []; InitEmpty, Always, TestLastFail ( - [["part_disk"; "/dev/sda"; "mbr"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; ["mkfs_b"; "vfat"; "33280"; "/dev/sda1"]]), []; InitEmpty, IfAvailable "ntfsprogs", TestRun ( [["part_disk"; "/dev/sda"; "mbr"]; @@ -9868,7 +9873,7 @@ device is stopped, but it is not destroyed or zeroed." }; "check_hash (ret, \"PART_ENTRY_NUMBER\", \"1\") == 0 && "^ "check_hash (ret, \"PART_ENTRY_TYPE\", \"0x83\") == 0 && "^ "check_hash (ret, \"PART_ENTRY_OFFSET\", \"128\") == 0 && "^ - "check_hash (ret, \"PART_ENTRY_SIZE\", \"1023745\") == 0"), []; + "check_hash (ret, \"PART_ENTRY_SIZE\", \"20971265\") == 0"), []; ]; shortdesc = "print block device attributes"; longdesc = "\ diff --git a/tests/c-api/tests-main.c b/tests/c-api/tests-main.c index feec7bc01..517d8a31c 100644 --- a/tests/c-api/tests-main.c +++ b/tests/c-api/tests-main.c @@ -440,17 +440,17 @@ create_handle (void) exit (EXIT_FAILURE); } - if (guestfs_add_drive_scratch (g, 524288000, -1) == -1) { + if (guestfs_add_drive_scratch (g, INT64_C(10)*1024*1024*1024, -1) == -1) { printf ("FAIL: guestfs_add_drive_scratch\n"); exit (EXIT_FAILURE); } - if (guestfs_add_drive_scratch (g, 524288000, -1) == -1) { + if (guestfs_add_drive_scratch (g, INT64_C(10)*1024*1024*1024, -1) == -1) { printf ("FAIL: guestfs_add_drive_scratch\n"); exit (EXIT_FAILURE); } - if (guestfs_add_drive_scratch (g, 10485760, -1) == -1) { + if (guestfs_add_drive_scratch (g, INT64_C(10)*1024*1024, -1) == -1) { printf ("FAIL: guestfs_add_drive_scratch\n"); exit (EXIT_FAILURE); }