[Libosinfo] [libosinfo PATCH v4 06/10] tests: Add test-imagelist

Pino Toscano ptoscano at redhat.com
Fri Nov 23 13:25:59 UTC 2018


On Friday, 23 November 2018 11:54:40 CET Fabiano Fidêncio wrote:
> +static void
> +test_filter(void)
> +{
> +    OsinfoImageList *list1 = osinfo_imagelist_new();
> +    OsinfoImageList *list2;
> +    OsinfoFilter *filter = osinfo_filter_new();
> +    OsinfoImage *ent1 = osinfo_image_new("foo1", "x86_64", "qcow2");
> +    OsinfoImage *ent2 = osinfo_image_new("foo2", "x86_64", "raw");
> +    OsinfoImage *ent3 = osinfo_image_new("foo3", "i686", "raw");
> +    OsinfoImage *ent4 = osinfo_image_new("foo4", "i686", "qcow2");
> +
> +    osinfo_entity_add_param(OSINFO_ENTITY(ent1), "class", "network");
> +    osinfo_entity_add_param(OSINFO_ENTITY(ent1), "class", "wilma");
> +    osinfo_entity_add_param(OSINFO_ENTITY(ent2), "class", "network");
> +    osinfo_entity_add_param(OSINFO_ENTITY(ent3), "class", "network");
> +    osinfo_entity_add_param(OSINFO_ENTITY(ent3), "class", "audio");
> +    osinfo_entity_add_param(OSINFO_ENTITY(ent4), "class", "audio");
> +
> +    osinfo_filter_add_constraint(filter, "class", "network");

Even if this is just a test, would not it better to use the actual
properties of the images, i.e. architecture, and format?

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20181123/70248d69/attachment.sig>


More information about the Libosinfo mailing list