mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
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.
This commit is contained in:
@@ -105,16 +105,16 @@ The test environment has 4 block devices:
|
||||
|
||||
=over 4
|
||||
|
||||
=item F</dev/sda> 500MB
|
||||
=item F</dev/sda> 10 GB
|
||||
|
||||
General block device for testing.
|
||||
|
||||
=item F</dev/sdb> 500MB
|
||||
=item F</dev/sdb> 10 GB
|
||||
|
||||
F</dev/sdb1> is an ext2 filesystem used for testing
|
||||
filesystem write operations.
|
||||
|
||||
=item F</dev/sdc> 10MB
|
||||
=item F</dev/sdc> 10 MB
|
||||
|
||||
Used in a few tests where two block devices are needed.
|
||||
|
||||
|
||||
@@ -4779,7 +4779,8 @@ C<blocksize> option of C<guestfs_mkfs>." };
|
||||
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<blockdev(8)> 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<guestfs_setcon>" };
|
||||
["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 = "\
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user