Richard W.M. Jones
2016-Feb-03 17:18 UTC
[Libguestfs] [PATCH 0/3] tests: Various fixes for btrfs and aarch64.
These patches fix btrfs on aarch64. You still need btrfs-progs 4.4 which was only released a few days ago. Rich.
Richard W.M. Jones
2016-Feb-03 17:18 UTC
[Libguestfs] [PATCH 1/3] 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 | 4 ++--
generator/actions.ml | 17 +++++++++++------
tests/c-api/tests-main.c | 6 +++---
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
index 32f901d..3ab1981 100644
--- a/docs/guestfs-hacking.pod
+++ b/docs/guestfs-hacking.pod
@@ -105,11 +105,11 @@ The test environment has 4 block devices:
=over 4
-=item F</dev/sda> 500MB
+=item F</dev/sda> 1GB
General block device for testing.
-=item F</dev/sdb> 500MB
+=item F</dev/sdb> 1GB
F</dev/sdb1> is an ext2 filesystem used for testing
filesystem write operations.
diff --git a/generator/actions.ml b/generator/actions.ml
index 4078082..881ec4e 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -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 = "\
diff --git a/tests/c-api/tests-main.c b/tests/c-api/tests-main.c
index feec7bc..517d8a3 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);
}
--
2.5.0
Richard W.M. Jones
2016-Feb-03 17:18 UTC
[Libguestfs] [PATCH 2/3] tests: btrfs: Don't test --leafsize, and use --nodesize 64K.
In btrfs-progs 4.4, the --leafsize parameter is deprecated. It's now
just an alias for --nodesize.
On aarch64, --nodesize 4096 does not work because it's smaller than
the page size (64K). Luckily we can test a 64K nodesize on any
platform, so use that instead.
---
generator/actions.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/generator/actions.ml b/generator/actions.ml
index 881ec4e..058f1e6 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -10235,7 +10235,7 @@ replacement
tests = [
InitEmpty, Always, TestRun (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs_btrfs"; "/dev/sda1"; "0";
"268435456"; "single"; "4096"; "test";
"single"; "4096"; "512"]]), []
+ ["mkfs_btrfs"; "/dev/sda1"; "0";
"268435456"; "single"; ""; "test";
"single"; "65536"; "512"]]), []
];
shortdesc = "create a btrfs filesystem";
longdesc = "\
--
2.5.0
Richard W.M. Jones
2016-Feb-03 17:18 UTC
[Libguestfs] [PATCH 3/3] tests: btrfs: Use a 2000 MB partition for btrfs test (instead of 200 MB).
One of the mkfs-btrfs tests used two 200 MB partitions. That isn't
enough to create a btrfs filesystem on aarch64 (with 64K page size).
Since we now have a 10 GB disk, we can make the test partition 10
times larger.
---
generator/actions.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generator/actions.ml b/generator/actions.ml
index 058f1e6..4eeb7b4 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12701,8 +12701,8 @@ This enable skinny metadata extent refs." };
tests = [
InitEmpty, Always, TestRun (
[["part_init"; "/dev/sda"; "mbr"];
- ["part_add"; "/dev/sda"; "p";
"64"; "409599"];
- ["part_add"; "/dev/sda"; "p";
"409600"; "819199"];
+ ["part_add"; "/dev/sda"; "p";
"64"; "4095999"];
+ ["part_add"; "/dev/sda"; "p";
"4096000"; "8191999"];
["mkfs_btrfs"; "/dev/sda1"; "";
""; "NOARG"; ""; "NOARG";
"NOARG"; ""; ""];
["mkfs_btrfs"; "/dev/sda2"; "";
""; "NOARG"; ""; "NOARG";
"NOARG"; ""; ""];
["mount"; "/dev/sda1"; "/"];
--
2.5.0
Richard W.M. Jones
2016-Feb-03 17:24 UTC
Re: [Libguestfs] [PATCH 1/3] tests: Increase the size of the /dev/sda and /dev/sdb test devices.
On Wed, Feb 03, 2016 at 05:18:47PM +0000, Richard W.M. Jones wrote:> 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 | 4 ++-- > generator/actions.ml | 17 +++++++++++------ > tests/c-api/tests-main.c | 6 +++--- > 3 files changed, 16 insertions(+), 11 deletions(-) > > diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod > index 32f901d..3ab1981 100644 > --- a/docs/guestfs-hacking.pod > +++ b/docs/guestfs-hacking.pod > @@ -105,11 +105,11 @@ The test environment has 4 block devices: > > =over 4 > > -=item F</dev/sda> 500MB > +=item F</dev/sda> 1GB > > General block device for testing. > > -=item F</dev/sdb> 500MB > +=item F</dev/sdb> 1GBSorry, just realized I didn't update the documentation correctly. These should obviously say 10GB. Rich.> F</dev/sdb1> is an ext2 filesystem used for testing > filesystem write operations. > diff --git a/generator/actions.ml b/generator/actions.ml > index 4078082..881ec4e 100644 > --- a/generator/actions.ml > +++ b/generator/actions.ml > @@ -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 = "\ > diff --git a/tests/c-api/tests-main.c b/tests/c-api/tests-main.c > index feec7bc..517d8a3 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); > } > -- > 2.5.0 > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Pino Toscano
2016-Feb-03 17:51 UTC
Re: [Libguestfs] [PATCH 0/3] tests: Various fixes for btrfs and aarch64.
On Wednesday 03 February 2016 17:18:46 Richard W.M. Jones wrote:> These patches fix btrfs on aarch64. You still need btrfs-progs 4.4 > which was only released a few days ago.The series (with patch #1 amended) LGTM. Thanks, -- Pino Toscano
Apparently Analagous Threads
- [PATCH 1/3] tests: Increase the size of the /dev/sda and /dev/sdb test devices.
- [PATCH 0/3] libguestfs: improve OpenSUSE support
- [PATCH 0/6] generator: Split up generator/actions.ml
- [PATCH] tests: reduce sizes of scratch disks to 2 GB
- [PATCH] mkfs: add 'label' optional argument