aboutsummaryrefslogtreecommitdiff
path: root/contrib/atf/atf-c/detail/fs_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/atf/atf-c/detail/fs_test.c')
-rw-r--r--contrib/atf/atf-c/detail/fs_test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/atf/atf-c/detail/fs_test.c b/contrib/atf/atf-c/detail/fs_test.c
index 3dbc4d3ba7ef..7812be0334b8 100644
--- a/contrib/atf/atf-c/detail/fs_test.c
+++ b/contrib/atf/atf-c/detail/fs_test.c
@@ -779,7 +779,7 @@ ATF_TC_BODY(rmdir_enotempty, tc)
atf_fs_path_fini(&p);
}
-ATF_TC(rmdir_eperm);
+ATF_TC_WITH_CLEANUP(rmdir_eperm);
ATF_TC_HEAD(rmdir_eperm, tc)
{
atf_tc_set_md_var(tc, "descr", "Tests the atf_fs_rmdir function");
@@ -808,6 +808,13 @@ ATF_TC_BODY(rmdir_eperm, tc)
atf_fs_path_fini(&p);
}
+ATF_TC_CLEANUP(rmdir_eperm, tc)
+{
+ if (chmod("test-dir", 0755) == -1) {
+ fprintf(stderr, "Failed to unprotect test-dir; test directory "
+ "cleanup will fail\n");
+ }
+}
ATF_TC(mkdtemp_ok);
ATF_TC_HEAD(mkdtemp_ok, tc)