summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-02-15 21:43:02 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2016-02-15 21:43:02 +0000
commit7b5f5fbc933a935e8e436d719e37e63922c420b2 (patch)
tree3eab0c3f5e90fcb4831e8880ffb6f488c48ac293
parentTest permissions behaviour, fix write permissions check (might need further w... (diff)
downloadnetfs-7b5f5fbc933a935e8e436d719e37e63922c420b2.tar.bz2
netfs-7b5f5fbc933a935e8e436d719e37e63922c420b2.tar.xz
netfs-7b5f5fbc933a935e8e436d719e37e63922c420b2.zip
Test mknod behaviour
-rw-r--r--netfs/unittests/testCore.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index fb41f65..69c8f70 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -281,6 +281,17 @@ BOOST_AUTO_TEST_CASE( access )
BOOST_REQUIRE_EQUAL(fuse->rmdir("/dir"), 0);
}
+BOOST_AUTO_TEST_CASE( mknod )
+{
+ BOOST_REQUIRE_EQUAL(fuse->mknod("/nod", 0600 | S_IFIFO, 0), 0);
+ BOOST_REQUIRE_EQUAL(fuse->mknod("/nod", 0600 | S_IFIFO, 0), -EEXIST);
+ struct stat st;
+ memset(&st, 0, sizeof(st));
+ BOOST_REQUIRE_EQUAL(fuse->getattr("/nod", &st), 0);
+ BOOST_REQUIRE_EQUAL(st.st_mode, 0600 | S_IFIFO);
+ BOOST_REQUIRE_EQUAL(fuse->unlink("/nod"), 0);
+}
+
BOOST_AUTO_TEST_SUITE_END();
BOOST_AUTO_TEST_CASE( testNoAuthNoPass )