From 7b5f5fbc933a935e8e436d719e37e63922c420b2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 15 Feb 2016 21:43:02 +0000 Subject: Test mknod behaviour --- netfs/unittests/testCore.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 ) -- cgit v1.2.3