diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-01-01 17:18:20 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-01-01 17:31:14 +0000 |
commit | 8d40943163eb67ee74d962bcf981f5a6dde82de6 (patch) | |
tree | 2af084a344faa7efa543c82ea4e4353b480765a1 | |
parent | Add test for writes with async disabled (now default) (diff) | |
download | netfs-8d40943163eb67ee74d962bcf981f5a6dde82de6.tar.bz2 netfs-8d40943163eb67ee74d962bcf981f5a6dde82de6.tar.xz netfs-8d40943163eb67ee74d962bcf981f5a6dde82de6.zip |
General test config for alternative setups
-rw-r--r-- | netfs/unittests/Jamfile.jam | 3 | ||||
-rw-r--r-- | netfs/unittests/altDaemon.xml | 11 | ||||
-rw-r--r-- | netfs/unittests/altFuse.xml (renamed from netfs/unittests/fgwritesFuse.xml) | 0 | ||||
-rw-r--r-- | netfs/unittests/testCore.cpp | 20 |
4 files changed, 27 insertions, 7 deletions
diff --git a/netfs/unittests/Jamfile.jam b/netfs/unittests/Jamfile.jam index 114895c..dbbecda 100644 --- a/netfs/unittests/Jamfile.jam +++ b/netfs/unittests/Jamfile.jam @@ -36,7 +36,8 @@ run testCore.cpp : : : <dependency>defaultDaemon.xml <dependency>defaultFuse.xml - <dependency>fgwritesFuse.xml + <dependency>altDaemon.xml + <dependency>altFuse.xml <dependency>secureDaemon.xml <dependency>secureFuse.xml <define>BOOST_TEST_DYN_LINK diff --git a/netfs/unittests/altDaemon.xml b/netfs/unittests/altDaemon.xml new file mode 100644 index 0000000..76711cc --- /dev/null +++ b/netfs/unittests/altDaemon.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="ascii"?> +<config> + <exports> + <export> + <name>testvol</name> + <export> + <root>/overridden</root> + </export> + </export> + </exports> +</config> diff --git a/netfs/unittests/fgwritesFuse.xml b/netfs/unittests/altFuse.xml index 37f55a3..37f55a3 100644 --- a/netfs/unittests/fgwritesFuse.xml +++ b/netfs/unittests/altFuse.xml diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp index 4aa2619..de5c9d2 100644 --- a/netfs/unittests/testCore.cpp +++ b/netfs/unittests/testCore.cpp @@ -61,6 +61,11 @@ class Core { const fuse_operations * fuse; }; +class AltCore : public Core { + public: + AltCore() : Core("altDaemon.xml", "altFuse.xml") { } +}; + BOOST_FIXTURE_TEST_SUITE( NetfsCore, Core ); BOOST_AUTO_TEST_CASE(fuse_operations_correct) @@ -495,25 +500,28 @@ BOOST_AUTO_TEST_CASE( utimens ) BOOST_AUTO_TEST_SUITE_END(); +BOOST_FIXTURE_TEST_SUITE( NetfsAltCore, AltCore ); + BOOST_AUTO_TEST_CASE( testFGWrites ) { - Core c("defaultDaemon.xml", "fgwritesFuse.xml"); struct fuse_file_info fi; memset(&fi, 0, sizeof(fi)); struct stat st; memset(&st, 0, sizeof(st)); fi.flags = O_RDWR; - BOOST_REQUIRE_EQUAL(c.fuse->create("/test", 0600, &fi), 0); - BOOST_REQUIRE_EQUAL(c.fuse->write("/test", "some test buffer", 16, 0, &fi), 16); - BOOST_REQUIRE_EQUAL(c.fuse->getattr("/test", &st), 0); + BOOST_REQUIRE_EQUAL(fuse->create("/test", 0600, &fi), 0); + BOOST_REQUIRE_EQUAL(fuse->write("/test", "some test buffer", 16, 0, &fi), 16); + BOOST_REQUIRE_EQUAL(fuse->getattr("/test", &st), 0); BOOST_REQUIRE_EQUAL(st.st_size, 16); char buf[11]; memset(&buf, 0, sizeof(buf)); - BOOST_REQUIRE_EQUAL(c.fuse->read("/test", buf, 10, 5, &fi), 10); + BOOST_REQUIRE_EQUAL(fuse->read("/test", buf, 10, 5, &fi), 10); BOOST_REQUIRE_EQUAL(buf, "test buffe"); - BOOST_REQUIRE_EQUAL(c.fuse->release("/test", &fi), 0); + BOOST_REQUIRE_EQUAL(fuse->release("/test", &fi), 0); } +BOOST_AUTO_TEST_SUITE_END(); + BOOST_AUTO_TEST_CASE( testNoAuthNoPass ) { Core c("defaultDaemon.xml", "defaultFuse.xml"); |