[PATCH 09/16] rpcgen: add test case for XDR serialization
Daniel P. Berrangé
berrange at redhat.com
Tue Mar 14 11:39:52 UTC 2023
On Thu, Mar 09, 2023 at 04:12:04PM +0100, Michal Prívozník wrote:
> On 3/8/23 17:39, Daniel P. Berrangé wrote:
> > Test the serialization done by libtirpc, so that when we later
> > switch to our own code, we can prove wire compatibility.
> >
> > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> > ---
> > build-aux/syntax-check.mk | 11 +-
> > scripts/rpcgen/tests/demo.x | 1 -
> > scripts/rpcgen/tests/meson.build | 15 +
> > scripts/rpcgen/tests/test_demo.c | 789 ++++++++++++++++++
> > scripts/rpcgen/tests/test_demo_enum.bin | Bin 0 -> 4 bytes
> > .../tests/test_demo_enum_fixed_array.bin | Bin 0 -> 52 bytes
> > .../tests/test_demo_enum_pointer_null.bin | Bin 0 -> 4 bytes
> > .../tests/test_demo_enum_pointer_set.bin | Bin 0 -> 8 bytes
> > .../rpcgen/tests/test_demo_enum_scalar.bin | Bin 0 -> 4 bytes
> > .../test_demo_enum_variable_array_empty.bin | Bin 0 -> 4 bytes
> > .../test_demo_enum_variable_array_set.bin | Bin 0 -> 16 bytes
> > .../tests/test_demo_int_fixed_array.bin | Bin 0 -> 12 bytes
> > .../tests/test_demo_int_pointer_null.bin | Bin 0 -> 4 bytes
> > .../tests/test_demo_int_pointer_set.bin | Bin 0 -> 8 bytes
> > scripts/rpcgen/tests/test_demo_int_scalar.bin | Bin 0 -> 4 bytes
> > .../test_demo_int_variable_array_empty.bin | Bin 0 -> 4 bytes
> > .../test_demo_int_variable_array_set.bin | Bin 0 -> 16 bytes
> > .../tests/test_demo_opaque_fixed_array.bin | Bin 0 -> 12 bytes
> > .../test_demo_opaque_variable_array_empty.bin | Bin 0 -> 4 bytes
> > .../test_demo_opaque_variable_array_set.bin | Bin 0 -> 8 bytes
> > .../test_demo_string_variable_array_empty.bin | Bin 0 -> 4 bytes
> > .../test_demo_string_variable_array_set.bin | Bin 0 -> 12 bytes
> > scripts/rpcgen/tests/test_demo_struct.bin | Bin 0 -> 8 bytes
> > .../tests/test_demo_struct_fixed_array.bin | Bin 0 -> 136 bytes
> > .../tests/test_demo_struct_pointer_null.bin | Bin 0 -> 4 bytes
> > .../tests/test_demo_struct_pointer_set.bin | Bin 0 -> 12 bytes
> > .../rpcgen/tests/test_demo_struct_scalar.bin | 1 +
> > .../test_demo_struct_variable_array_empty.bin | Bin 0 -> 4 bytes
> > .../test_demo_struct_variable_array_set.bin | Bin 0 -> 28 bytes
> > .../tests/test_demo_test_struct_all_types.bin | Bin 0 -> 1752 bytes
> > scripts/rpcgen/tests/test_demo_union_case.bin | Bin 0 -> 8 bytes
> > .../rpcgen/tests/test_demo_union_default.bin | Bin 0 -> 8 bytes
> > .../tests/test_demo_union_fixed_array.bin | Bin 0 -> 168 bytes
> > .../tests/test_demo_union_no_default_case.bin | Bin 0 -> 8 bytes
> > .../tests/test_demo_union_pointer_null.bin | Bin 0 -> 4 bytes
> > .../tests/test_demo_union_pointer_set.bin | Bin 0 -> 12 bytes
> > .../rpcgen/tests/test_demo_union_scalar.bin | Bin 0 -> 8 bytes
> > .../test_demo_union_variable_array_empty.bin | Bin 0 -> 4 bytes
> > .../test_demo_union_variable_array_set.bin | Bin 0 -> 28 bytes
> > .../test_demo_union_void_default_case.bin | Bin 0 -> 8 bytes
> > .../test_demo_union_void_default_default.bin | 1 +
> > 41 files changed, 813 insertions(+), 5 deletions(-)
> > create mode 100644 scripts/rpcgen/tests/test_demo.c
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum_fixed_array.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum_pointer_null.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum_pointer_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum_scalar.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum_variable_array_empty.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_enum_variable_array_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_int_fixed_array.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_int_pointer_null.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_int_pointer_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_int_scalar.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_int_variable_array_empty.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_int_variable_array_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_opaque_fixed_array.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_opaque_variable_array_empty.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_opaque_variable_array_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_string_variable_array_empty.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_string_variable_array_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct_fixed_array.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct_pointer_null.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct_pointer_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct_scalar.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct_variable_array_empty.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_struct_variable_array_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_test_struct_all_types.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_case.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_default.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_fixed_array.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_no_default_case.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_pointer_null.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_pointer_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_scalar.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_variable_array_empty.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_variable_array_set.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_void_default_case.bin
> > create mode 100644 scripts/rpcgen/tests/test_demo_union_void_default_default.bin
> >
>
> > diff --git a/scripts/rpcgen/tests/test_demo_struct_scalar.bin b/scripts/rpcgen/tests/test_demo_struct_scalar.bin
> > new file mode 100644
> > index 0000000000..0e6959d56a
> > --- /dev/null
> > +++ b/scripts/rpcgen/tests/test_demo_struct_scalar.bin
> > @@ -0,0 +1 @@
> > +
> >
>
> I don't know what's going on but this surely can't be an empty file.
> Also, some other .bin files are missing. Squash this in (generated by
> VIR_TEST_REGENERATE_OUTPUT=1)
I think something must have gone wrong with git formatting, because
the changes you suggested below were exactly what my local commits
actually have & tests pass. Rather odd.
..snip..
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list