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.

(cherry picked from commit 1a0fa85397)
(cherry picked from commit c66ae93415)
This commit is contained in:
Thomas Haller 2023-05-22 13:03:43 +02:00
parent d2e1c8bee0
commit edf23f434e
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -3244,7 +3244,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;
@ -3287,7 +3289,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);
}
}
/*****************************************************************************/