diff options
-rw-r--r-- | netfs/unittests/testCore.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp index fbca658..56c695e 100644 --- a/netfs/unittests/testCore.cpp +++ b/netfs/unittests/testCore.cpp @@ -372,10 +372,14 @@ BOOST_AUTO_TEST_CASE( renameToDir ) memset(&fi, 0, sizeof(fi)); BOOST_REQUIRE_EQUAL(fuse->create("/file", 0600, &fi), 0); BOOST_REQUIRE_EQUAL(fuse->release("/file", &fi), 0); - BOOST_REQUIRE_EQUAL(fuse->mkdir("/dir", 0000), 0); - BOOST_REQUIRE_EQUAL(fuse->rename("/file", "/dir/file"), -EACCES); - BOOST_REQUIRE_EQUAL(fuse->chmod("/dir", 0700), 0); + BOOST_REQUIRE_EQUAL(fuse->mkdir("/dir", 0700), 0); BOOST_REQUIRE_EQUAL(fuse->rename("/file", "/dir"), -EISDIR); + disableWriteOnDir(fuse, "/dir"); + BOOST_REQUIRE_EQUAL(fuse->rename("/file", "/dir/file"), -EACCES); + enableWriteOnDir(fuse, "/dir"); + disableWriteOnDir(fuse, "/"); + BOOST_REQUIRE_EQUAL(fuse->rename("/file", "/dir/file"), -EACCES); + enableWriteOnDir(fuse, "/"); BOOST_REQUIRE_EQUAL(fuse->rename("/file", "/dir/file"), 0); BOOST_REQUIRE_EQUAL(fuse->unlink("/file"), -ENOENT); BOOST_REQUIRE_EQUAL(fuse->unlink("/dir/file"), 0); |