Update to 1.5.0 release

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2019-05-09 10:30:43 +02:00
parent 11b62a9fd9
commit eb61fb62dc
10 changed files with 8 additions and 53213 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
*.src.rpm
*.tar.gz
x86_64
/libosinfo-1.5.0.tar.gz.asc

View File

@ -1,38 +0,0 @@
From 2626058a7921749387f8d3107241af7507f48c65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Mon, 1 Apr 2019 22:40:48 +0200
Subject: [PATCH] media: Fix usage of application id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Christophe Fergeau pointed this issue out during the review of 6d789033e
and, even though, the bogus code ended up merged (sorry, mea culpa
here!).
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
---
osinfo/osinfo_media.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
index b16fcf6..4f86c2b 100644
--- a/osinfo/osinfo_media.c
+++ b/osinfo/osinfo_media.c
@@ -830,10 +830,10 @@ create_from_location_async_data(CreateFromLocationAsyncData *data)
osinfo_entity_set_param(OSINFO_ENTITY(media),
OSINFO_MEDIA_PROP_PUBLISHER_ID,
data->publisher);
- if (!is_str_empty(data->pvd.application))
+ if (!is_str_empty(data->application))
osinfo_entity_set_param(OSINFO_ENTITY(media),
OSINFO_MEDIA_PROP_APPLICATION_ID,
- data->pvd.application);
+ data->application);
index = (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? 0 : 1;
vol_size = ((gint64) data->pvd.volume_space_size[index]) *
--
2.20.1

View File

@ -1,37 +0,0 @@
From 1940739805409af9e39c61dbfe238e6c9b1519b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Wed, 10 Apr 2019 13:45:14 +0200
Subject: [PATCH] loader: Properly load the arch value for images
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
osinfo_loader_image() has been considering the XML tag for the
images' architecture was "architecture", while it actually is "arch".
By trying to read the wrong tag, no arch was loaded, causing then any
image load to fail with:
CRITICAL **: 13:30:06.539: osinfo_entity_set_param: assertion 'value != NULL' failed
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
---
osinfo/osinfo_loader.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index e30148b..84c25e5 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1312,8 +1312,7 @@ static OsinfoImage *osinfo_loader_image(OsinfoLoader *loader,
{ NULL, G_TYPE_INVALID }
};
- gchar *arch = (gchar *)xmlGetProp(root,
- BAD_CAST OSINFO_IMAGE_PROP_ARCHITECTURE);
+ gchar *arch = (gchar *)xmlGetProp(root, BAD_CAST "arch");
gchar *format = (gchar *)xmlGetProp(root,
BAD_CAST OSINFO_IMAGE_PROP_FORMAT);
gchar *cloud_init = (gchar *)xmlGetProp(root,
--
2.20.1

View File

@ -1,559 +0,0 @@
From d0f081759b99f6642ab5fe0e875dfd878f7ed8d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Wed, 10 Apr 2019 14:56:56 +0200
Subject: [PATCH] tests: Remove test-*.uris
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Those tests are now part of osinfo-db.
With this change we can get rid of the curl dependency we have.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
---
README | 1 -
configure.ac | 8 ---
tests/Makefile.am | 26 +---------
tests/test-imageuris.c | 90 --------------------------------
tests/test-mediauris.c | 96 ----------------------------------
tests/test-treeuris.c | 94 ---------------------------------
tests/test-uris-common.c | 109 ---------------------------------------
tests/test-uris-common.h | 26 ----------
8 files changed, 2 insertions(+), 448 deletions(-)
delete mode 100644 tests/test-imageuris.c
delete mode 100644 tests/test-mediauris.c
delete mode 100644 tests/test-treeuris.c
delete mode 100644 tests/test-uris-common.c
delete mode 100644 tests/test-uris-common.h
diff --git a/README b/README
index e3d528c..7f73e74 100644
--- a/README
+++ b/README
@@ -26,7 +26,6 @@ Dependencies
- Optional:
- gobject-introspection
- - libcurl (for tests only)
- Vala (build-time only)
Patch submissions
diff --git a/configure.ac b/configure.ac
index fef3cbc..6c3ea01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,14 +55,6 @@ AC_ARG_ENABLE([tests],
AS_HELP_STRING([--enable-tests], [enable test suite]),
[], [enable_tests=yes])
-if test "x$enable_tests" != "xno" ; then
- have_curl=no
- PKG_CHECK_MODULES([CURL], [libcurl], [have_curl=yes], [:])
- AC_SUBST(CURL_CFLAGS)
- AC_SUBST(CURL_LIBS)
-fi
-AM_CONDITIONAL([HAVE_CURL],[test "x$have_curl" = "xyes"])
-
AM_CONDITIONAL([ENABLE_TESTS],[test "x$enable_tests" = "xyes"])
LIBOSINFO_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a822af2..27b0f8d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,14 +23,6 @@ check_PROGRAMS = \
test-imagelist \
$(NULL)
-if HAVE_CURL
-check_PROGRAMS += \
- test-mediauris \
- test-treeuris \
- test-imageuris \
- $(NULL)
-endif
-
COMMON_LDADD = \
$(COVERAGE_LDFLAGS) \
$(GLIB_LIBS) \
@@ -78,8 +70,8 @@ test_list_LDADD = $(COMMON_LDADD)
test_list_CFLAGS = $(COMMON_CFLAGS)
test_list_SOURCES = test-list.c
-test_media_LDADD = $(COMMON_LDADD) $(CURL_LIBS)
-test_media_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS)
+test_media_LDADD = $(COMMON_LDADD)
+test_media_CFLAGS = $(COMMON_CFLAGS)
test_media_SOURCES = test-media.c
test_devicelist_LDADD = $(COMMON_LDADD)
@@ -110,20 +102,6 @@ test_isodetect_LDADD = $(COMMON_LDADD)
test_isodetect_CFLAGS = $(COMMON_CFLAGS)
test_isodetect_SOURCES = test-isodetect.c
-if HAVE_CURL
-test_mediauris_LDADD = $(COMMON_LDADD) $(CURL_LIBS)
-test_mediauris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS)
-test_mediauris_SOURCES = test-mediauris.c test-uris-common.c test-uris-common.h
-
-test_treeuris_LDADD = $(COMMON_LDADD) $(CURL_LIBS)
-test_treeuris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS)
-test_treeuris_SOURCES = test-treeuris.c test-uris-common.c test-uris-common.h
-
-test_imageuris_LDADD = $(COMMON_LDADD) $(CURL_LIBS)
-test_imageuris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS)
-test_imageuris_SOURCES = test-imageuris.c test-uris-common.c test-uris-common.h
-endif
-
test_install_script_LDADD = $(COMMON_LDADD)
test_install_script_CFLAGS = $(COMMON_CFLAGS)
test_install_script_SOURCES = test-install-script.c
diff --git a/tests/test-imageuris.c b/tests/test-imageuris.c
deleted file mode 100644
index ca6e648..0000000
--- a/tests/test-imageuris.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2108 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>
- *
- * Authors:
- * Daniel P. Berrange <berrange@redhat.com>
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <osinfo/osinfo.h>
-#include <curl/curl.h>
-
-#include "test-uris-common.h"
-
-static void
-test_imageuris(gconstpointer data)
-{
- OsinfoOs *os = OSINFO_OS(data);
- GError *error = NULL;
-
- OsinfoImageList *imagelist = osinfo_os_get_image_list(os);
-
- test_uri(OSINFO_LIST(imagelist), (GetURLFunc) osinfo_image_get_url, &error);
-
- g_assert_no_error(error);
-
- g_object_unref(imagelist);
-}
-
-int
-main(int argc, char *argv[])
-{
- int ret;
- OsinfoLoader *loader = osinfo_loader_new();
- OsinfoDb *db = osinfo_loader_get_db(loader);
- OsinfoOsList *oslist = NULL;
- GError *error = NULL;
-
- g_test_init(&argc, &argv, NULL);
- g_test_set_nonfatal_assertions();
-
- if (!g_getenv("LIBOSINFO_NETWORK_TESTS"))
- return 77; /* Skip */
-
- /* Upfront so we don't confuse valgrind */
- curl_global_init(CURL_GLOBAL_ALL);
- osinfo_db_get_type();
- osinfo_os_get_type();
- osinfo_list_get_type();
- osinfo_oslist_get_type();
- osinfo_filter_get_type();
-
- osinfo_loader_process_default_path(loader, &error);
- g_assert_no_error(error);
-
- oslist = osinfo_db_get_os_list(db);
- test_uris(oslist, "/imageuris/uris", test_imageuris);
-
- ret = g_test_run();
-
- if (oslist)
- g_object_unref(oslist);
-
- g_object_unref(loader);
-
- curl_global_cleanup();
-
- return ret;
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c
deleted file mode 100644
index c9e09c7..0000000
--- a/tests/test-mediauris.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2009-2012, 2014 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>
- *
- * Authors:
- * Daniel P. Berrange <berrange@redhat.com>
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <osinfo/osinfo.h>
-#include <curl/curl.h>
-
-#include "test-uris-common.h"
-
-static void
-test_mediauris(gconstpointer data)
-{
- OsinfoOs *os = OSINFO_OS(data);
- GError *error = NULL;
-
- OsinfoMediaList *medialist = osinfo_os_get_media_list(os);
-
- test_uri(OSINFO_LIST(medialist), (GetURLFunc) osinfo_media_get_url, &error);
-
- g_assert_no_error(error);
-
- g_object_unref(medialist);
-}
-
-int
-main(int argc, char *argv[])
-{
- int ret;
- OsinfoLoader *loader = osinfo_loader_new();
- OsinfoDb *db = osinfo_loader_get_db(loader);
- OsinfoOsList *oslist = NULL;
- GError *error = NULL;
-
- g_test_init(&argc, &argv, NULL);
- g_test_set_nonfatal_assertions();
-
- if (!g_getenv("LIBOSINFO_NETWORK_TESTS"))
- return 77; /* Skip */
-
- /* Upfront so we don't confuse valgrind */
- curl_global_init(CURL_GLOBAL_ALL);
- osinfo_entity_get_type();
- osinfo_db_get_type();
- osinfo_device_get_type();
- osinfo_platform_get_type();
- osinfo_os_get_type();
- osinfo_list_get_type();
- osinfo_devicelist_get_type();
- osinfo_platformlist_get_type();
- osinfo_oslist_get_type();
- osinfo_filter_get_type();
-
-
- osinfo_loader_process_default_path(loader, &error);
- g_assert_no_error(error);
-
- oslist = osinfo_db_get_os_list(db);
- test_uris(oslist, "/mediauris/uris", test_mediauris);
-
- ret = g_test_run();
-
- if (oslist)
- g_object_unref(oslist);
-
- g_object_unref(loader);
-
- curl_global_cleanup();
-
- return ret;
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/tests/test-treeuris.c b/tests/test-treeuris.c
deleted file mode 100644
index 48ce82a..0000000
--- a/tests/test-treeuris.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2009-2012, 2014 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>
- *
- * Authors:
- * Daniel P. Berrange <berrange@redhat.com>
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <osinfo/osinfo.h>
-#include <curl/curl.h>
-
-#include "test-uris-common.h"
-
-static void
-test_treeuris(gconstpointer data)
-{
- OsinfoOs *os = OSINFO_OS(data);
- GError *error = NULL;
- OsinfoTreeList *treelist = osinfo_os_get_tree_list(os);
-
- test_uri(OSINFO_LIST(treelist), (GetURLFunc) osinfo_tree_get_url, &error);
-
- g_assert_no_error(error);
-
- g_object_unref(treelist);
-}
-
-int
-main(int argc, char *argv[])
-{
- int ret;
- OsinfoLoader *loader = osinfo_loader_new();
- OsinfoDb *db = osinfo_loader_get_db(loader);
- OsinfoOsList *oslist = NULL;
- GError *error = NULL;
-
- g_test_init(&argc, &argv, NULL);
- g_test_set_nonfatal_assertions();
-
- if (!g_getenv("LIBOSINFO_NETWORK_TESTS"))
- return 77; /* Skip */
-
- /* Upfront so we don't confuse valgrind */
- curl_global_init(CURL_GLOBAL_ALL);
- osinfo_entity_get_type();
- osinfo_db_get_type();
- osinfo_device_get_type();
- osinfo_platform_get_type();
- osinfo_os_get_type();
- osinfo_list_get_type();
- osinfo_devicelist_get_type();
- osinfo_platformlist_get_type();
- osinfo_oslist_get_type();
- osinfo_filter_get_type();
-
- osinfo_loader_process_default_path(loader, &error);
- g_assert_no_error(error);
-
- oslist = osinfo_db_get_os_list(db);
- test_uris(oslist, "/treeuris/uris", test_treeuris);
-
- ret = g_test_run();
-
- if (oslist)
- g_object_unref(oslist);
-
- g_object_unref(loader);
-
- curl_global_cleanup();
-
- return ret;
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/tests/test-uris-common.c b/tests/test-uris-common.c
deleted file mode 100644
index 8ebe4ea..0000000
--- a/tests/test-uris-common.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2019 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <osinfo/osinfo.h>
-#include <curl/curl.h>
-
-#include "test-uris-common.h"
-
-static size_t write_callback(char *ptr,
- size_t size,
- size_t nmemb,
- void *userdata)
-{
- abort();
-}
-
-void test_uri(OsinfoList *list, GetURLFunc get_url_func, GError **error)
-{
- GList *el = NULL, *tmp;
-
- tmp = el = osinfo_list_get_elements(list);
- while (tmp) {
- const gchar *url = get_url_func(tmp->data);
- const gchar *debugstr;
- CURL *curl;
- CURLcode res;
- long response_code;
-
- if (url == NULL || g_str_equal(url, "")) {
- tmp = tmp->next;
- continue;
- }
-
- curl = curl_easy_init();
- curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
- curl_easy_setopt(curl, CURLOPT_TIMEOUT, 60L);
- curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
- curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
-
- if ((debugstr = g_getenv("LIBOSINFO_TEST_DEBUG"))) {
- int debug_level = atoi(debugstr);
-
- curl_easy_setopt(curl, CURLOPT_VERBOSE, debug_level > 0 ? 1L : 0L);
- }
-
- g_test_message("%s", url);
- curl_easy_setopt(curl, CURLOPT_URL, url);
- res = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
-
- g_test_message("res=%d, %s; code=%ld", res, curl_easy_strerror(res), response_code);
-
- if (res == CURLE_OPERATION_TIMEDOUT) {
- g_printerr("Ignoring network timeout failure for %s\n", url);
- } else {
- if (res != CURLE_OK) {
- g_printerr("Failed URI %s res=%d (%s) code=%ld\n",
- url, res, curl_easy_strerror(res), response_code);
- }
- g_assert_cmpint(res, ==, CURLE_OK);
- }
-
- tmp = tmp->next;
- curl_easy_cleanup(curl);
- }
-
- g_list_free(el);
-}
-
-
-void test_uris(OsinfoOsList *oslist, const gchar *prefix, TestURLFunc test_func)
-{
- GList *osel = NULL, *tmp;
-
- tmp = osel = osinfo_list_get_elements(OSINFO_LIST(oslist));
-
- while (tmp) {
- OsinfoOs *os = tmp->data;
- gchar *name = g_strdup_printf("%s/%s",
- prefix,
- osinfo_product_get_short_id(OSINFO_PRODUCT(os)));
-
- g_test_add_data_func(name, os, test_func);
- g_free(name);
-
- tmp = tmp->next;
- }
-
- g_list_free(osel);
-}
diff --git a/tests/test-uris-common.h b/tests/test-uris-common.h
deleted file mode 100644
index 34cc242..0000000
--- a/tests/test-uris-common.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2019 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-#include <config.h>
-
-#include <osinfo/osinfo.h>
-
-typedef const gchar *(*GetURLFunc)(gpointer p);
-typedef void (*TestURLFunc)(gconstpointer p);
-
-void test_uri(OsinfoList *list, GetURLFunc get_url_func, GError **error);
-void test_uris(OsinfoOsList *oslist, const gchar *prefix, TestURLFunc test_func);
--
2.20.1

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +0,0 @@
From afdc58833731620db11bb07610773acd69064cf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Tue, 19 Mar 2019 13:17:03 +0100
Subject: [PATCH] test-os: Remove test_resources_minimum_recommended_maximum
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This test is now part of osinfo-db.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
---
tests/test-os.c | 150 ------------------------------------------------
1 file changed, 150 deletions(-)
diff --git a/tests/test-os.c b/tests/test-os.c
index 178bd15..80f866b 100644
--- a/tests/test-os.c
+++ b/tests/test-os.c
@@ -270,154 +270,6 @@ static void test_resources_basic(void)
}
-static void test_n_cpus(OsinfoResources *resources1, OsinfoResources *resources2)
-{
- gint resources1_cpus, resources2_cpus;
-
- resources1_cpus = osinfo_resources_get_n_cpus(resources1);
- resources2_cpus = osinfo_resources_get_n_cpus(resources2);
-
- if (resources2_cpus >= 0 && resources1_cpus >= 0)
- g_assert_true(resources2_cpus >= resources1_cpus);
-}
-
-
-static void test_cpu(OsinfoResources *resources1, OsinfoResources *resources2)
-{
- gint64 resources1_cpu, resources2_cpu;
-
- resources1_cpu = osinfo_resources_get_cpu(resources1);
- resources2_cpu = osinfo_resources_get_cpu(resources2);
-
- if (resources2_cpu >= 0 && resources1_cpu >= 0)
- g_assert_true(resources2_cpu >= resources1_cpu);
-}
-
-
-static void test_ram(OsinfoResources *resources1, OsinfoResources *resources2)
-{
- gint64 resources1_ram, resources2_ram;
-
- resources1_ram = osinfo_resources_get_ram(resources1);
- resources2_ram = osinfo_resources_get_ram(resources2);
-
- if (resources2_ram >= 0 && resources1_ram >= 0)
- g_assert_true(resources2_ram >= resources1_ram);
-}
-
-
-static void test_storage(OsinfoResources *resources1, OsinfoResources *resources2)
-{
- gint64 resources1_storage, resources2_storage;
-
- resources1_storage = osinfo_resources_get_storage(resources1);
- resources2_storage = osinfo_resources_get_storage(resources2);
-
- if (resources2_storage >= 0 && resources1_storage >= 0)
- g_assert_true(resources2_storage >= resources1_storage);
-}
-
-
-static void
-compare_resources(OsinfoOs *os,
- OsinfoList *resourceslist1,
- OsinfoList *resourceslist2)
-{
- GList *list1, *list2;
- GList *it1, *it2;
-
- list1 = osinfo_list_get_elements(resourceslist1);
- list2 = osinfo_list_get_elements(resourceslist2);
-
- if (list1 == NULL || list2 == NULL)
- return;
-
- for (it1 = list1; it1 != NULL; it1 = it1->next) {
- OsinfoResources *resources1 = it1->data;
- const gchar *arch1;
-
- arch1 = osinfo_resources_get_architecture(resources1);
-
- for (it2 = list2; it2 != NULL; it2 = it2->next) {
- OsinfoResources *resources2 = it2->data;
- const gchar *arch2 = osinfo_resources_get_architecture(resources2);
-
- if (g_str_equal(arch1, arch2)) {
- const gchar *name;
-
- name = osinfo_product_get_name(OSINFO_PRODUCT(os));
-
- g_test_message("checking %s (architecture: %s)",
- name, arch1);
-
- test_n_cpus(resources1, resources2);
- test_cpu(resources1, resources2);
- test_ram(resources1, resources2);
- test_storage(resources1, resources2);
- break;
- }
- }
- }
-}
-
-
-static void
-test_resources_minimum_recommended_maximum(void)
-{
- OsinfoLoader *loader = osinfo_loader_new();
- OsinfoDb *db = osinfo_loader_get_db(loader);
- OsinfoOsList *oslist;
- GList *oses;
- GList *oses_it;
- GError *error = NULL;
-
- g_assert_true(OSINFO_IS_LOADER(loader));
- g_assert_true(OSINFO_IS_DB(db));
-
- osinfo_loader_process_default_path(loader, &error);
- g_assert_no_error(error);
-
- oslist = osinfo_db_get_os_list(db);
- oses = osinfo_list_get_elements(OSINFO_LIST(oslist));
-
- for (oses_it = oses; oses_it != NULL; oses_it = oses_it->next) {
- OsinfoOs *os = oses_it->data;
- OsinfoResourcesList *minimum_list, *recommended_list, *maximum_list;
-
- minimum_list = osinfo_os_get_minimum_resources(os);
- recommended_list = osinfo_os_get_recommended_resources(os);
- maximum_list = osinfo_os_get_maximum_resources(os);
-
- if (osinfo_list_get_length(OSINFO_LIST(minimum_list)) > 0 &&
- osinfo_list_get_length(OSINFO_LIST(recommended_list)) > 0)
- compare_resources(os,
- OSINFO_LIST(minimum_list),
- OSINFO_LIST(recommended_list));
-
- if (osinfo_list_get_length(OSINFO_LIST(minimum_list)) > 0 &&
- osinfo_list_get_length(OSINFO_LIST(maximum_list)) > 0)
- compare_resources(os,
- OSINFO_LIST(minimum_list),
- OSINFO_LIST(maximum_list));
-
- if (osinfo_list_get_length(OSINFO_LIST(recommended_list)) > 0 &&
- osinfo_list_get_length(OSINFO_LIST(maximum_list)) > 0)
- compare_resources(os,
- OSINFO_LIST(recommended_list),
- OSINFO_LIST(maximum_list));
-
- g_object_unref(minimum_list);
- g_object_unref(recommended_list);
- g_object_unref(maximum_list);
- }
-
- g_object_unref(oslist);
- g_list_free(oses);
-
- g_object_unref(loader);
-}
-
-
static void
test_uniqueness(OsinfoOs *os,
OsinfoResourcesList *(*get_resources)(OsinfoOs *))
@@ -1000,8 +852,6 @@ main(int argc, char *argv[])
g_test_add_func("/os/devices/inheritance/removal",
test_devices_inheritance_removal);
g_test_add_func("/os/resources/basic", test_resources_basic);
- g_test_add_func("/os/resources/minimum_recommended_maximum",
- test_resources_minimum_recommended_maximum);
g_test_add_func("/os/resources/uniqueness", test_resources_uniqueness);
g_test_add_func("/os/resources/inheritance", test_resources_inheritance);
g_test_add_func("/os/find_install_script", test_find_install_script);
--
2.20.1

View File

@ -1,108 +0,0 @@
From ef34c41da7a58fec499607f3b42d24e950dd24b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Wed, 20 Mar 2019 11:55:31 +0100
Subject: [PATCH] test-os: Remove test_resources_uniqueness
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This test is now part of osinfo-db.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
---
tests/test-os.c | 71 -------------------------------------------------
1 file changed, 71 deletions(-)
diff --git a/tests/test-os.c b/tests/test-os.c
index 80f866b..1a5ab67 100644
--- a/tests/test-os.c
+++ b/tests/test-os.c
@@ -270,76 +270,6 @@ static void test_resources_basic(void)
}
-static void
-test_uniqueness(OsinfoOs *os,
- OsinfoResourcesList *(*get_resources)(OsinfoOs *))
-{
- OsinfoResourcesList *resourceslist;
- GList *arches = NULL;
- GList *list, *it;
-
- resourceslist = get_resources(os);
- list = osinfo_list_get_elements(OSINFO_LIST(resourceslist));
-
- for (it = list; it != NULL; it = it->next) {
- OsinfoResources *resources = it->data;
- const gchar *arch = osinfo_resources_get_architecture(resources);
-
- if (g_list_find_custom(arches, arch, (GCompareFunc) g_strcmp0) == NULL) {
- arches = g_list_prepend(arches, (gchar *)arch);
- continue;
- }
-
- g_test_message("\"%s\" has more than one resources entry for architecture \"%s\"",
- osinfo_product_get_short_id(OSINFO_PRODUCT(os)),
- arch);
- g_test_fail();
- }
-
- g_list_free(arches);
- g_list_free(list);
- g_object_unref(resourceslist);
-}
-
-
-static void
-test_resources_uniqueness(void)
-{
- OsinfoLoader *loader = osinfo_loader_new();
- OsinfoDb *db = osinfo_loader_get_db(loader);
- OsinfoOsList *oslist;
- GList *oses;
- GList *oses_it;
- GError *error = NULL;
-
- g_assert_true(OSINFO_IS_LOADER(loader));
- g_assert_true(OSINFO_IS_DB(db));
-
- osinfo_loader_process_default_path(loader, &error);
- g_assert_no_error(error);
-
- oslist = osinfo_db_get_os_list(db);
- oses = osinfo_list_get_elements(OSINFO_LIST(oslist));
-
- for (oses_it = oses; oses_it != NULL; oses_it = oses_it->next) {
- OsinfoOs *os = oses_it->data;
-
- g_test_message("Testing minimum resources uniqueness for \"%s\"",
- osinfo_product_get_short_id(OSINFO_PRODUCT(os)));
- test_uniqueness(os, osinfo_os_get_minimum_resources);
-
- g_test_message("Testing recommended resources uniqueness for \"%s\"",
- osinfo_product_get_short_id(OSINFO_PRODUCT(os)));
- test_uniqueness(os, osinfo_os_get_recommended_resources);
- }
-
- g_object_unref(oslist);
- g_list_free(oses);
-
- g_object_unref(loader);
-}
-
-
static GList *get_all_distros(OsinfoOsList *oslist)
{
GList *oses;
@@ -852,7 +782,6 @@ main(int argc, char *argv[])
g_test_add_func("/os/devices/inheritance/removal",
test_devices_inheritance_removal);
g_test_add_func("/os/resources/basic", test_resources_basic);
- g_test_add_func("/os/resources/uniqueness", test_resources_uniqueness);
g_test_add_func("/os/resources/inheritance", test_resources_inheritance);
g_test_add_func("/os/find_install_script", test_find_install_script);
--
2.20.1

View File

@ -1,183 +0,0 @@
From e878c7b91d6385ebcf77aa8a5b9c1789f3b206bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Wed, 20 Mar 2019 14:44:45 +0100
Subject: [PATCH] test-os: Remove test_devices_duplication
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This test is now part of osinfo-db.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
---
tests/test-os.c | 146 ------------------------------------------------
1 file changed, 146 deletions(-)
diff --git a/tests/test-os.c b/tests/test-os.c
index 1a5ab67..ea7f98c 100644
--- a/tests/test-os.c
+++ b/tests/test-os.c
@@ -270,151 +270,6 @@ static void test_resources_basic(void)
}
-static GList *get_all_distros(OsinfoOsList *oslist)
-{
- GList *oses;
- GList *distros = NULL;
- GList *it;
-
- oses = osinfo_list_get_elements(OSINFO_LIST(oslist));
- for (it = oses; it != NULL; it = it->next) {
- OsinfoOs *os;
- const gchar *distro;
-
- os = OSINFO_OS(it->data);
- distro = osinfo_os_get_distro(os);
-
- if (g_list_find_custom(distros, distro, (GCompareFunc) g_strcmp0) == NULL)
- distros = g_list_prepend(distros, (gchar *)distro);
- }
-
- g_list_free(oses);
-
- return distros;
-}
-
-
-static void check_duplicated_devices_cb(OsinfoProduct *product,
- gpointer user_data)
-{
- OsinfoOs *os = OSINFO_OS(user_data);
- OsinfoOs *foreach_os = OSINFO_OS(product);
- OsinfoDeviceList *devices_os, *devices_foreach_os;
- GList *list_devices = NULL, *list_foreach_devices = NULL, *list_duplicated = NULL;
- GList *l;
-
- if (os == foreach_os)
- return;
-
- devices_os = osinfo_os_get_devices(os, NULL);
- devices_foreach_os = osinfo_os_get_devices(foreach_os, NULL);
-
- if (osinfo_list_get_length(OSINFO_LIST(devices_os)) == 0 ||
- osinfo_list_get_length(OSINFO_LIST(devices_foreach_os)) == 0)
- goto done;
-
- list_devices = osinfo_list_get_elements(OSINFO_LIST(devices_os));
- list_foreach_devices = osinfo_list_get_elements(OSINFO_LIST(devices_foreach_os));
-
- for (l = list_devices; l != NULL; l = l->next) {
- OsinfoDevice *d = OSINFO_DEVICE(l->data);
- GList *ll;
-
- for (ll = list_foreach_devices; ll != NULL; ll = ll->next) {
- OsinfoDevice *dd = OSINFO_DEVICE(ll->data);
- if (d == dd)
- list_duplicated = g_list_prepend(list_duplicated, d);
- }
- }
-
- if (list_duplicated != NULL) {
- gchar *string = NULL;
- for (l = list_duplicated; l != NULL; l = l->next) {
- gchar *tmp = NULL;
- if (string != NULL)
- tmp = g_strdup_printf("%s\n - %s\n",
- string,
- osinfo_device_get_name(OSINFO_DEVICE(l->data)));
- else
- tmp = g_strdup_printf("\n - %s",
- osinfo_device_get_name(OSINFO_DEVICE(l->data)));
-
- g_free(string);
- string = tmp;
- }
-
- g_debug("\nTesting \"%s\" against \"%s\" and found the following duplicated devices: %s",
- osinfo_product_get_short_id(OSINFO_PRODUCT(os)),
- osinfo_product_get_short_id(product),
- string);
- g_free(string);
-
- g_test_fail();
- }
-
- done:
- g_list_free(list_duplicated);
- g_list_free(list_devices);
- g_list_free(list_foreach_devices);
- g_object_unref(devices_os);
- g_object_unref(devices_foreach_os);
-}
-
-
-static void check_duplicated_devices(OsinfoOs *os)
-{
- osinfo_product_foreach_related(OSINFO_PRODUCT(os),
- OSINFO_PRODUCT_FOREACH_FLAG_DERIVES_FROM |
- OSINFO_PRODUCT_FOREACH_FLAG_CLONES,
- check_duplicated_devices_cb,
- os);
-}
-
-
-static void test_devices_duplication(void)
-{
- OsinfoLoader *loader = osinfo_loader_new();
- OsinfoDb *db = osinfo_loader_get_db(loader);
- OsinfoOsList *all_oses_list;
- GList *distros, *l;
- GError *error = NULL;
-
- g_assert_true(OSINFO_IS_LOADER(loader));
- g_assert_true(OSINFO_IS_DB(db));
-
- osinfo_loader_process_default_path(loader, &error);
- g_assert_no_error(error);
-
- all_oses_list = osinfo_db_get_os_list(db);
- distros = get_all_distros(all_oses_list);
-
- for (l = distros; l != NULL; l = l->next) {
- const gchar *distro;
- OsinfoOsList *oslist;
- OsinfoFilter *filter;
- int i;
-
- distro = l->data;
-
- filter = osinfo_filter_new();
- osinfo_filter_add_constraint(filter, OSINFO_OS_PROP_DISTRO, distro);
- oslist = OSINFO_OSLIST(osinfo_list_new_filtered(OSINFO_LIST(all_oses_list), filter));
-
- for (i = 0; i < osinfo_list_get_length(OSINFO_LIST(oslist)); i++) {
- OsinfoOs *os = OSINFO_OS(osinfo_list_get_nth(OSINFO_LIST(oslist), i));
- check_duplicated_devices(os);
- }
-
- g_object_unref(filter);
- g_object_unref(oslist);
- }
-
- g_list_free(distros);
- g_object_unref(all_oses_list);
- g_object_unref(loader);
-}
-
-
static void
devices_inheritance_basic_check(OsinfoDb *db,
const gchar *os_id)
@@ -776,7 +631,6 @@ main(int argc, char *argv[])
g_test_add_func("/os/devices", test_devices);
g_test_add_func("/os/devices_filter", test_devices_filter);
g_test_add_func("/os/device_driver", test_device_driver);
- g_test_add_func("/os/devices/duplication", test_devices_duplication);
g_test_add_func("/os/devices/inheritance/basic",
test_devices_inheritance_basic);
g_test_add_func("/os/devices/inheritance/removal",
--
2.20.1

View File

@ -2,21 +2,12 @@
Summary: A library for managing OS information for virtualization
Name: libosinfo
Version: 1.4.0
Release: 3%{?dist}%{?extra_release}
Version: 1.5.0
Release: 1%{?dist}%{?extra_release}
License: LGPLv2+
Source: https://releases.pagure.io/%{name}/%{name}-%{version}.tar.gz
URL: https://libosinfo.org/
###Patches###
Patch0001: 0001-media-Fix-usage-of-application-id.patch
Patch0002: 0002-loader-Properly-load-the-arch-value-for-images.patch
Patch0003: 0003-tests-Remove-test-.uris.patch
Patch0004: 0004-tests-Remove-test-isodetect.patch
Patch0005: 0005-test-os-Remove-test_resources_minimum_recommended_ma.patch
Patch0006: 0006-test-os-Remove-test_resources_uniqueness.patch
Patch0007: 0007-test-os-Remove-test_devices_duplication.patch
BuildRequires: gettext-devel
BuildRequires: glib2-devel
BuildRequires: libxml2-devel >= 2.6.0
@ -106,6 +97,9 @@ fi
%{_datadir}/vala/vapi/libosinfo-1.0.vapi
%changelog
* Thu May 09 2019 Fabiano Fidêncio <fidencio@redhat.com> - 1.5.0-1
- Update to 1.5.0 release
* Thu Apr 11 2019 Fabiano Fidêncio <fidencio@redhat.com> - 1.4.0-3
- rhbz#1698845: Require GVFS

View File

@ -1 +1,2 @@
SHA512 (libosinfo-1.4.0.tar.gz) = 531b7acf811add53252e52917f8b13b409dbe7a4bc5837dcbe34e729b0f294e760d5a57c5c1c56f1f65217b7fc6e285a56a6fa49d36f02cf696b7cc181db1fe5
SHA512 (libosinfo-1.5.0.tar.gz) = d5d5749eac1dbba0450fdff732c99c5c66b78b0889679cb9f3fd58e119fea4dd1c730013f4cad887b413abe21399143abb89b9d9554b906f117ba0cfc6685e5e
SHA512 (libosinfo-1.5.0.tar.gz.asc) = c86f0c13b2134526abc12ff5f593e955ff2e1bb9aecb8afb7fd48f715797b1ef43d287e72dcb3dd1366b55a2708d8bd9bbdf3ca85d0faa799a442b897aadb80b