[glib/glib-2-62: 1/2] tests: Fix skipping mkdir-with-parents-permission test
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-62: 1/2] tests: Fix skipping mkdir-with-parents-permission test
- Date: Fri, 13 Sep 2019 12:00:56 +0000 (UTC)
commit 62eb3bc3b65ca213981cbf06795c134000e04ab4
Author: Philip Withnall <withnall endlessm com>
Date: Mon Sep 2 12:21:11 2019 +0100
tests: Fix skipping mkdir-with-parents-permission test
If the user has `CAP_DAC_OVERRIDE` or similar (for example, if running
the tests as root), the `mkdir-with-parents-permission` test is skipped.
The check for `CAP_DAC_OVERRIDE` was by creating a subdirectory of the
test directory. That subdirectory, however, was never removed, which
caused a ‘directory not empty’ error when trying to delete the test
directory.
Fix that by correctly deleting the subdirectory if skipping the test.
Signed-off-by: Philip Withnall <withnall endlessm com>
glib/tests/fileutils.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index a86ba478d..07a91a67f 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -548,6 +548,7 @@ test_mkdir_with_parents_permission (void)
if (g_mkdir (subdir2, 0700) == 0)
{
g_test_skip ("have CAP_DAC_OVERRIDE or equivalent, cannot test");
+ g_remove (subdir2);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]