#define BOOST_TEST_MODULE GitFS_Core #include #include "mockDefs.h" #include "sys/stat.h" using namespace GitFS; using namespace GitFS::Test; BOOST_TEST_GLOBAL_FIXTURE(Service); BOOST_FIXTURE_TEST_SUITE(client, Client) // TODO BOOST_AUTO_TEST_SUITE_END(); BOOST_FIXTURE_TEST_SUITE(volume, VolumeClient) BOOST_AUTO_TEST_CASE( access ) { // Noting is writable // Directories are all readable and executable BOOST_CHECK_EQUAL(EINVAL, v->access(env, "", R_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/", R_OK)); BOOST_CHECK_EQUAL(EACCES, v->access(env, "/", W_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/", X_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/src", R_OK)); BOOST_CHECK_EQUAL(EACCES, v->access(env, "/src", W_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/src", X_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/src/Jamfile.jam", R_OK)); BOOST_CHECK_EQUAL(EACCES, v->access(env, "/src/Jamfile.jam", W_OK)); BOOST_CHECK_EQUAL(EACCES, v->access(env, "/src/Jamfile.jam", X_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/unittests/fixtures/executable", R_OK)); BOOST_CHECK_EQUAL(EACCES, v->access(env, "/unittests/fixtures/executable", W_OK)); BOOST_CHECK_EQUAL(0, v->access(env, "/unittests/fixtures/executable", X_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, "/missing", R_OK)); BOOST_CHECK_EQUAL(EACCES, v->access(env, "/missing", W_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, "/missing", X_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, "/.", R_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, "/../", R_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, ".", R_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, "..", R_OK)); BOOST_CHECK_EQUAL(ENOENT, v->access(env, "../", R_OK)); } BOOST_AUTO_TEST_CASE( statRoot ) { //auto a = v->getattr(env, "/"); //BOOST_CHECK_EQUAL(0170555, a.mode); //BOOST_CHECK_EQUAL(1563566842, a.mtime); //BOOST_CHECK_EQUAL(1563566842, a.ctime); //BOOST_CHECK_EQUAL(1563566842, a.atime); } BOOST_AUTO_TEST_CASE(stat_root) { auto attr = v->getattr(env, ""); } BOOST_AUTO_TEST_SUITE_END();