From 1a0fa8539737c784f17a5639e67a87a8636aa23b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 22 May 2023 13:03:43 +0200 Subject: [PATCH] platform/tests: check errno on failure to umount() in test_netns_bind_to_path() The umount() call failed in a test. Rework the assertion, so we might see the errno of the problem. --- src/core/platform/tests/test-link.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c index 5bec6082b7..d510779c16 100644 --- a/src/core/platform/tests/test-link.c +++ b/src/core/platform/tests/test-link.c @@ -3451,7 +3451,9 @@ test_netns_bind_to_path(gpointer fixture, gconstpointer test_data) nm_auto_pop_netns NMPNetns *netns_pop = NULL; NMPlatform *platforms[3]; NMPNetns *netns; + int errsv; int i; + int r; if (_test_netns_check_skip()) return; @@ -3494,7 +3496,12 @@ test_netns_bind_to_path(gpointer fixture, gconstpointer test_data) !=, 0); - g_assert_cmpint(umount(P_VAR_RUN), ==, 0); + r = umount(P_VAR_RUN); + if (r != 0) { + errsv = errno; + g_assert_cmpint(errsv, ==, 0); + g_assert_cmpint(r, ==, 0); + } } /*****************************************************************************/