From 2118a8f73bdcfed1fc58c14ecc67744acf16d210 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 2 Sep 2019 12:21:11 +0100 Subject: [PATCH] tests: Fix skipping mkdir-with-parents-permission test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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 {