summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netfs/unittests/testCore.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index ffdc411..f72770c 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -312,6 +312,19 @@ BOOST_AUTO_TEST_CASE( renameToDir )
BOOST_REQUIRE_EQUAL(fuse->rmdir("/dir"), 0);
}
+BOOST_AUTO_TEST_CASE( chown )
+{
+ BOOST_REQUIRE_EQUAL(fuse->mkdir("/dir", 0777), 0);
+ BOOST_REQUIRE_EQUAL(fuse->chown("/dir", getuid(), getgid()), 0);
+ struct stat st;
+ memset(&st, 0, sizeof(st));
+ BOOST_REQUIRE_EQUAL(fuse->getattr("/dir", &st), 0);
+ BOOST_REQUIRE_EQUAL(st.st_uid, getuid());
+ BOOST_REQUIRE_EQUAL(st.st_gid, getgid());
+ BOOST_REQUIRE_EQUAL(fuse->chown("/dir", -2, getgid()), -EPERM);
+ BOOST_REQUIRE_EQUAL(fuse->rmdir("/dir"), 0);
+}
+
BOOST_AUTO_TEST_SUITE_END();
BOOST_AUTO_TEST_CASE( testNoAuthNoPass )