diff options
author | Philip Withnall <withnall@endlessm.com> | 2019-09-02 12:21:11 +0100 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-09-02 13:35:44 +0100 |
commit | 2118a8f73bdcfed1fc58c14ecc67744acf16d210 (patch) | |
tree | db2fa7acaf685e53604d40c30b4f8f00d212bd49 | |
parent | 4a089f9227ca948cec145e29499353829af8141b (diff) | |
download | glib-2118a8f73bdcfed1fc58c14ecc67744acf16d210.tar.gz |
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>
-rw-r--r-- | glib/tests/fileutils.c | 1 |
1 files changed, 1 insertions, 0 deletions
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 { |