From 4c25da8a7ba7437657c3e2da592145113d3532f4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Jul 2019 10:53:14 +0100 Subject: Initial commit Not a lot of stuff, hard coded paths, tests against /usr/portage --- .gitignore | 1 + Jamroot.jam | 31 +++++++++ src/Jamfile.jam | 12 ++++ src/blob.cpp | 49 ++++++++++++++ src/blob.h | 27 ++++++++ src/dir.cpp | 30 +++++++++ src/dir.h | 24 +++++++ src/git.cpp | 30 +++++++++ src/git.h | 91 ++++++++++++++++++++++++++ src/main.cpp | 28 ++++++++ src/repo.cpp | 174 +++++++++++++++++++++++++++++++++++++++++++++++++ src/repo.h | 42 ++++++++++++ src/repoList.cpp | 16 +++++ src/repoList.h | 17 +++++ unittests/Jamfile.jam | 29 +++++++++ unittests/core.cpp | 69 ++++++++++++++++++++ unittests/mockDefs.cpp | 26 ++++++++ unittests/mockDefs.h | 31 +++++++++ 18 files changed, 727 insertions(+) create mode 100644 .gitignore create mode 100644 Jamroot.jam create mode 100644 src/Jamfile.jam create mode 100644 src/blob.cpp create mode 100644 src/blob.h create mode 100644 src/dir.cpp create mode 100644 src/dir.h create mode 100644 src/git.cpp create mode 100644 src/git.h create mode 100644 src/main.cpp create mode 100644 src/repo.cpp create mode 100644 src/repo.h create mode 100644 src/repoList.cpp create mode 100644 src/repoList.h create mode 100644 unittests/Jamfile.jam create mode 100644 unittests/core.cpp create mode 100644 unittests/mockDefs.cpp create mode 100644 unittests/mockDefs.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin diff --git a/Jamroot.jam b/Jamroot.jam new file mode 100644 index 0000000..a2d56a8 --- /dev/null +++ b/Jamroot.jam @@ -0,0 +1,31 @@ +import os ; +using gcc : : [ os.environ CXX ] ; + +variant coverage : debug ; + +project + : requirements + ICE_CPP11_MAPPING + "-std=c++17" + "-fvisibility=hidden -fvisibility-inlines-hidden" + "-Wl,-z,defs,--warn-once,--gc-sections" + release:"-flto=2" + release:"-flto=2" + debug:"-W -Wall -Wextra -Werror -Wwrite-strings" + coverage:"--coverage" + coverage:"--coverage" + ; + +lib adhocutil : : : : /usr/include/adhocutil ; +lib dbppcore : : : : /usr/include/dbpp ; +lib git2 ; +lib Ice ; +lib Ice++11 ; +lib IceBox++11 ; +lib icetray : : : : /usr/include/icetray dbppcore ; +lib netfs-api : : : : /usr/include/netfs Ice++11 IceBox++11 pthread ; +lib pthread ; + +build-project src ; +build-project unittests ; + diff --git a/src/Jamfile.jam b/src/Jamfile.jam new file mode 100644 index 0000000..db6267c --- /dev/null +++ b/src/Jamfile.jam @@ -0,0 +1,12 @@ + +lib gitfs : + [ glob *.cpp ] + : + ..//adhocutil + ..//icetray + ..//git2 + ..//netfs-api + : : + ..//netfs-api + ; + diff --git a/src/blob.cpp b/src/blob.cpp new file mode 100644 index 0000000..8fb0509 --- /dev/null +++ b/src/blob.cpp @@ -0,0 +1,49 @@ +#include +#include "blob.h" + +GitFS::Blob::Blob(const GitFS::Git::RepositoryPtr & r, const GitFS::Git::TreeEntryPtr & te) : + blob(Git::BlobLookup(r, *git_tree_entry_id(te.get()))), + blobSize(git_blob_rawsize(blob.get())), + blobContent(static_cast(git_blob_rawcontent(blob.get()))) +{ +} + +void +GitFS::Blob::close(const ::Ice::Current& current) +{ + current.adapter->remove(current.id); +} + + +NetFS::Attr +GitFS::Blob::fgetattr(ReqEnv, const ::Ice::Current&) +{ + return {}; +} + + +NetFS::Buffer +GitFS::Blob::read(long long int offset, long long int size, const ::Ice::Current&) +{ + if (offset > blobSize) { + return {}; + } + auto len = std::min(blobSize - offset, size); + return NetFS::Buffer(blobContent + offset, blobContent + offset + len); +} + + +void +GitFS::Blob::ftruncate(ReqEnv, long long int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Blob::write(long long int, long long int, Buffer, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + diff --git a/src/blob.h b/src/blob.h new file mode 100644 index 0000000..0a2a77d --- /dev/null +++ b/src/blob.h @@ -0,0 +1,27 @@ +#ifndef GITFS_BLOB_H +#define GITFS_BLOB_H + +#include +#include "git.h" + +namespace GitFS { + using namespace NetFS; + class Blob : public File { + public: + Blob(const GitFS::Git::RepositoryPtr & r, const Git::TreeEntryPtr &); + + void close(const ::Ice::Current& current) override; + Attr fgetattr(ReqEnv env, const ::Ice::Current& current) override; + Buffer read(long long int offset, long long int size, const ::Ice::Current& current) override; + void ftruncate(ReqEnv env, long long int size, const ::Ice::Current& current) override; + void write(long long int offset, long long int size, Buffer data, const ::Ice::Current& current) override; + + private: + Git::BlobPtr blob; + const decltype(git_blob_rawsize({})) blobSize; + const char * const blobContent; + }; +} + +#endif + diff --git a/src/dir.cpp b/src/dir.cpp new file mode 100644 index 0000000..8a9fd86 --- /dev/null +++ b/src/dir.cpp @@ -0,0 +1,30 @@ +#include +#include "dir.h" + +GitFS::Directory::Directory(const GitFS::Git::TreePtr & t, const std::string & p) : + tree(t), + path(p) +{ +} + +void +GitFS::Directory::close(const ::Ice::Current& current) +{ + current.adapter->remove(current.id); +} + + +NetFS::NameList +GitFS::Directory::readdir(const ::Ice::Current&) +{ + return {}; +} + + +NetFS::DirectoryContents +GitFS::Directory::listdir(const ::Ice::Current&) +{ + return {}; +} + + diff --git a/src/dir.h b/src/dir.h new file mode 100644 index 0000000..74afde3 --- /dev/null +++ b/src/dir.h @@ -0,0 +1,24 @@ +#ifndef GITFS_DIRECTORY_H +#define GITFS_DIRECTORY_H + +#include +#include "git.h" + +namespace GitFS { + using namespace NetFS; + class Directory : public DirectoryV2 { + public: + Directory(const GitFS::Git::TreePtr & r, const std::string &); + + void close(const ::Ice::Current& current) override; + NameList readdir(const ::Ice::Current& current) override; + DirectoryContents listdir(const ::Ice::Current& current) override; + + private: + Git::TreePtr tree; + const std::string path; + }; +} + +#endif + diff --git a/src/git.cpp b/src/git.cpp new file mode 100644 index 0000000..084e6ca --- /dev/null +++ b/src/git.cpp @@ -0,0 +1,30 @@ +#include "git.h" +#include +#include + +namespace GitFS { + namespace Git { + void + throwError(int err) + { +#if LIBGIT2_VER_MINOR >= 28 + const git_error * e = git_error_last(); +#else + const git_error * e = giterr_last(); +#endif + throw Error { err, e->klass, e->message }; + } + } +} + +namespace std { + std::ostream & + operator<<(std::ostream & s, const git_oid & oid) + { + char str[GIT_OID_HEXSZ + 1]; + git_oid_tostr(str, sizeof(str), &oid); + s.write(str, GIT_OID_HEXSZ); + return s; + } +} + diff --git a/src/git.h b/src/git.h new file mode 100644 index 0000000..c0ae4e3 --- /dev/null +++ b/src/git.h @@ -0,0 +1,91 @@ +#ifndef GITFS_GIT_H +#define GITFS_GIT_H + +#include +#include +#include + +namespace GitFS { + namespace Git { + struct Error { + int err; + int klass; + const char * message; + }; + void throwError(int err); + + template + void + gitSafe(int (*func)(P...), A ... p) + { + if (int _giterror = func(p...); _giterror != 0) { + throwError(_giterror); + } + } + + template + using TPtr = std::shared_ptr; + + template + auto + gitSafeGet(int(*get)(R**, P...), void(*release)(R*), A ... p) + { + R * r = nullptr; + gitSafe(get, &r, p...); + return TPtr(r, release); + } + + template + auto + gitSafeGet(int(*get)(R**, P...), A ... p) + { + R * r = nullptr; + gitSafe(get, &r, p...); + return r; + } + + inline auto OidParse(const std::string_view & str) + { + git_oid oid; + gitSafe(git_oid_fromstrn, &oid, str.data(), str.length()); + return oid; + } + + inline auto RepositoryOpenBare(const std::string & path) + { + return gitSafeGet(git_repository_open_bare, git_repository_free, path.c_str()); + } + using RepositoryPtr = decltype(RepositoryOpenBare("")); + + inline auto BlobLookup(const RepositoryPtr & repo, const git_oid & blob) + { + return gitSafeGet(git_blob_lookup, git_blob_free, repo.get(), &blob); + } + using BlobPtr = decltype(BlobLookup({}, {})); + + inline auto CommitLookup(const RepositoryPtr & repo, const git_oid & commitId) + { + return gitSafeGet(git_commit_lookup, git_commit_free, repo.get(), &commitId); + } + using CommitPtr = decltype(CommitLookup({}, {})); + + inline auto TreeLookup(const RepositoryPtr & repo, const git_oid & treeId) + { + return gitSafeGet(git_tree_lookup, git_tree_free, repo.get(), &treeId); + } + using TreePtr = decltype(TreeLookup({}, {})); + + inline auto TreeEntryByPath(const TreePtr & tree, const std::string & path) + { + return gitSafeGet(git_tree_entry_bypath, git_tree_entry_free, tree.get(), path.c_str() + 1); + } + using TreeEntryPtr = decltype(TreeEntryByPath({}, {})); + } +} + +namespace std { + std::ostream & operator<<(std::ostream &, const git_oid &); +} + +#endif + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..0666a3c --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include "repoList.h" + +namespace GitFS { + class Main : public IceTray::Service { + public: + Main() + { + git_libgit2_init(); + } + + ~Main() + { + git_libgit2_shutdown(); + } + + void addObjects(const std::string &, const Ice::CommunicatorPtr & ic, const Ice::StringSeq &, const Ice::ObjectAdapterPtr & adp) override + { + IceTray::Cube::addObject(adp, "Service", ic->getProperties()); + } + }; + + NAMEDFACTORY("default", Main, IceTray::ServiceFactory); +} + diff --git a/src/repo.cpp b/src/repo.cpp new file mode 100644 index 0000000..299f2ce --- /dev/null +++ b/src/repo.cpp @@ -0,0 +1,174 @@ +#include +#include +#include "repo.h" +#include "blob.h" +#include "dir.h" + +GitFS::Repo::Repo() : + repo(Git::RepositoryOpenBare("/usr/portage/.git")), + commit(Git::CommitLookup(repo, Git::OidParse("97a435f30472eb941f96234d274b3aeb492e2793"))), + tree(Git::TreeLookup(repo, *git_commit_tree_id(commit.get()))) +{ +} + +void +GitFS::Repo::disconnect(const ::Ice::Current& current) +{ + current.adapter->remove(current.id); +} + + +NetFS::DirectoryPrxPtr +GitFS::Repo::opendir(ReqEnv, ::std::string path, const ::Ice::Current& ice) +{ + return Ice::uncheckedCast(ice.adapter->addWithUUID( + std::make_shared(tree, path))); +} + + +NetFS::VFS +GitFS::Repo::statfs(ReqEnv, ::std::string, const ::Ice::Current&) +{ + return {}; +} + + +int +GitFS::Repo::access(ReqEnv, ::std::string path, int mode, const ::Ice::Current&) +{ + if (mode & W_OK) return EACCES; + if (path.empty()) return EINVAL; + if (path == "/") return 0; + + try { + auto e = Git::TreeEntryByPath(tree, path); + const auto emode = git_tree_entry_filemode(e.get()); + + if (S_ISDIR(emode)) return 0; + if (mode & R_OK && !(S_IRUSR & emode)) return EACCES; + if (mode & X_OK && !(S_IXUSR & emode)) return EACCES; + + return 0; + } + catch (const Git::Error & e) { + if (e.err == GIT_ENOTFOUND) { + return ENOENT; + } + throw NetFS::SystemError(EIO); + } +} + + +NetFS::Attr +GitFS::Repo::getattr(ReqEnv, ::std::string path, const ::Ice::Current&) +{ + NetFS::Attr a {}; + (void)path; + a.ctime = a.atime = a.mtime = git_commit_time(commit.get()); + return a; +} + + +::std::string +GitFS::Repo::readlink(ReqEnv, ::std::string path, const ::Ice::Current&) +{ + auto e = Git::TreeEntryByPath(tree, path); + if (!e) throw NetFS::SystemError(ENOENT); + const auto emode = git_tree_entry_filemode(e.get()); + if (!S_ISLNK(emode)) throw NetFS::SystemError(EINVAL); + return {}; +} + + +NetFS::FilePrxPtr +GitFS::Repo::open(ReqEnv, ::std::string path, int, const ::Ice::Current& ice) +{ + return Ice::uncheckedCast(ice.adapter->addWithUUID( + std::make_shared(repo, Git::TreeEntryByPath(tree, path)))); +} + + +NetFS::FilePrxPtr +GitFS::Repo::create(ReqEnv, ::std::string, int, int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::truncate(ReqEnv, ::std::string, long long int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::unlink(ReqEnv, ::std::string, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::mkdir(ReqEnv, ::std::string, int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::rmdir(ReqEnv, ::std::string, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::mknod(ReqEnv, ::std::string, int, int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::symlink(ReqEnv, ::std::string, ::std::string, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::link(ReqEnv, ::std::string, ::std::string, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::rename(ReqEnv, ::std::string, ::std::string, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::chmod(ReqEnv, ::std::string, int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::chown(ReqEnv, ::std::string, int, int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + +void +GitFS::Repo::utimens(ReqEnv, ::std::string, long long int, long long int, long long int, long long int, const ::Ice::Current&) +{ + throw NetFS::SystemError(EROFS); +} + + diff --git a/src/repo.h b/src/repo.h new file mode 100644 index 0000000..e6f7d94 --- /dev/null +++ b/src/repo.h @@ -0,0 +1,42 @@ +#ifndef GITFS_REPO_H +#define GITFS_REPO_H + +#include +#include "git.h" + +namespace GitFS { + using namespace NetFS; + class Repo : public Volume { + public: + Repo(); + + void disconnect(const ::Ice::Current& current) override; + DirectoryPrxPtr opendir(ReqEnv env, ::std::string path, const ::Ice::Current& current) override; + VFS statfs(ReqEnv env, ::std::string path, const ::Ice::Current& current) override; + int access(ReqEnv env, ::std::string path, int mode, const ::Ice::Current& current) override; + Attr getattr(ReqEnv env, ::std::string path, const ::Ice::Current& current) override; + ::std::string readlink(ReqEnv env, ::std::string path, const ::Ice::Current& current) override; + FilePrxPtr open(ReqEnv env, ::std::string path, int flags, const ::Ice::Current& current) override; + FilePrxPtr create(ReqEnv env, ::std::string path, int flags, int mode, const ::Ice::Current& current) override; + void truncate(ReqEnv env, ::std::string path, long long int size, const ::Ice::Current& current) override; + void unlink(ReqEnv env, ::std::string path, const ::Ice::Current& current) override; + void mkdir(ReqEnv env, ::std::string path, int mode, const ::Ice::Current& current) override; + void rmdir(ReqEnv env, ::std::string path, const ::Ice::Current& current) override; + void mknod(ReqEnv env, ::std::string path, int mode, int dev, const ::Ice::Current& current) override; + void symlink(ReqEnv env, ::std::string path1, ::std::string path2, const ::Ice::Current& current) override; + void link(ReqEnv env, ::std::string path1, ::std::string path2, const ::Ice::Current& current) override; + void rename(ReqEnv env, ::std::string from, ::std::string to, const ::Ice::Current& current) override; + void chmod(ReqEnv env, ::std::string path, int mode, const ::Ice::Current& current) override; + void chown(ReqEnv env, ::std::string path, int uid, int gid, const ::Ice::Current& current) override; + void utimens(ReqEnv env, ::std::string path, long long int atime, long long int atimens, long long int mtime, long long int mtimens, const ::Ice::Current& current) override; + + private: + Git::RepositoryPtr repo; + Git::CommitPtr commit; + Git::TreePtr tree; + }; +} + +#endif + + diff --git a/src/repoList.cpp b/src/repoList.cpp new file mode 100644 index 0000000..0ee92c5 --- /dev/null +++ b/src/repoList.cpp @@ -0,0 +1,16 @@ +#include +#include "repoList.h" +#include "repo.h" + +GitFS::RepoList::RepoList(const Ice::PropertiesPtr &) +{ + +} + +NetFS::VolumePrxPtr +GitFS::RepoList::connect(const ::std::string, const ::std::string, + const ::Ice::Current & ice) +{ + return Ice::uncheckedCast(ice.adapter->addWithUUID(std::make_shared())); +} + diff --git a/src/repoList.h b/src/repoList.h new file mode 100644 index 0000000..ac8b885 --- /dev/null +++ b/src/repoList.h @@ -0,0 +1,17 @@ +#ifndef GITFS_REPOLIST_H +#define GITFS_REPOLIST_H + +#include +#include + +namespace GitFS { + class RepoList : public NetFS::Service { + public: + RepoList(const Ice::PropertiesPtr & ptr); + + virtual NetFS::VolumePrxPtr connect(const ::std::string volume, const ::std::string auth, const ::Ice::Current& current) override; + }; +} + +#endif + diff --git a/unittests/Jamfile.jam b/unittests/Jamfile.jam new file mode 100644 index 0000000..9de6ea6 --- /dev/null +++ b/unittests/Jamfile.jam @@ -0,0 +1,29 @@ +import testing ; + +lib boost_utf : : boost_unit_test_framework ; +lib dryice : : : : ..//icetray ; + +path-constant me : . ; + +lib common : + mockDefs.cpp + : + dryice + ../src//gitfs + ..//adhocutil + boost_utf + ROOT=\"$(me)\" + : : + dryice + ../src//gitfs + boost_utf + ROOT=\"$(me)\" + BOOST_TEST_DYN_LINK + ; + + +run core.cpp : : : + ../src//gitfs + common + ; + diff --git a/unittests/core.cpp b/unittests/core.cpp new file mode 100644 index 0000000..9b38dfe --- /dev/null +++ b/unittests/core.cpp @@ -0,0 +1,69 @@ +#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, "/metadata", R_OK)); + BOOST_CHECK_EQUAL(EACCES, v->access(env, "/metadata", W_OK)); + BOOST_CHECK_EQUAL(0, v->access(env, "/metadata", X_OK)); + + BOOST_CHECK_EQUAL(0, v->access(env, "/metadata/timestamp.chk", R_OK)); + BOOST_CHECK_EQUAL(EACCES, v->access(env, "/metadata/timestamp.chk", W_OK)); + BOOST_CHECK_EQUAL(EACCES, v->access(env, "/metadata/timestamp.chk", X_OK)); + + BOOST_CHECK_EQUAL(0, v->access(env, "/app-antivirus/skyldav/files/skyldav.initd", R_OK)); + BOOST_CHECK_EQUAL(EACCES, v->access(env, "/app-antivirus/skyldav/files/skyldav.initd", W_OK)); + BOOST_CHECK_EQUAL(0, v->access(env, "/app-antivirus/skyldav/files/skyldav.initd", 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(); + diff --git a/unittests/mockDefs.cpp b/unittests/mockDefs.cpp new file mode 100644 index 0000000..78ad270 --- /dev/null +++ b/unittests/mockDefs.cpp @@ -0,0 +1,26 @@ +#include +#include "mockDefs.h" + +GitFS::Test::Service::Service() +{ +} + +GitFS::Test::Client::Client() : + s(getProxy("Service")) +{ + BOOST_TEST_REQUIRE(s); + s->ice_ping(); +} + +GitFS::Test::VolumeClient::VolumeClient() : + v(s->connect("testrepo", "testauth")) +{ + BOOST_TEST_REQUIRE(v); + v->ice_ping(); +} + +GitFS::Test::VolumeClient::~VolumeClient() +{ + v->disconnect(); +} + diff --git a/unittests/mockDefs.h b/unittests/mockDefs.h new file mode 100644 index 0000000..f6a6c99 --- /dev/null +++ b/unittests/mockDefs.h @@ -0,0 +1,31 @@ +#ifndef GITFS_TEST_MOCKDEFS_H +#define GITFS_TEST_MOCKDEFS_H + +#include +#include +#include + +namespace GitFS::Test { + class DLL_PUBLIC Service : public IceTray::DryIce { + public: + Service(); + }; + + class DLL_PUBLIC Client : public IceTray::DryIceClient { + public: + Client(); + + const NetFS::ServicePrxPtr s; + }; + class DLL_PUBLIC VolumeClient : public Client { + public: + VolumeClient(); + ~VolumeClient(); + + const NetFS::ReqEnv env; + const NetFS::VolumePrxPtr v; + }; +} + +#endif + -- cgit v1.2.3