diff options
Diffstat (limited to 'blobs-ipmid')
-rw-r--r-- | blobs-ipmid/blobs.hpp | 11 | ||||
-rw-r--r-- | blobs-ipmid/manager.hpp | 14 | ||||
-rw-r--r-- | blobs-ipmid/test/blob_mock.hpp | 2 | ||||
-rw-r--r-- | blobs-ipmid/test/manager_mock.hpp | 2 |
4 files changed, 29 insertions, 0 deletions
diff --git a/blobs-ipmid/blobs.hpp b/blobs-ipmid/blobs.hpp index b6672b7..0014fd4 100644 --- a/blobs-ipmid/blobs.hpp +++ b/blobs-ipmid/blobs.hpp @@ -106,6 +106,17 @@ class GenericBlobInterface const std::vector<uint8_t>& data) = 0; /** + * Attempt to write metadata to a blob. + * + * @param[in] session - the session id. + * @param[in] offset - offset into the blob. + * @param[in] data - the data to write. + * @return bool - was able to write. + */ + virtual bool writeMeta(uint16_t session, uint32_t offset, + const std::vector<uint8_t>& data) = 0; + + /** * Attempt to commit to a blob. * * @param[in] session - the session id. diff --git a/blobs-ipmid/manager.hpp b/blobs-ipmid/manager.hpp index 884271c..d7282e6 100644 --- a/blobs-ipmid/manager.hpp +++ b/blobs-ipmid/manager.hpp @@ -56,6 +56,9 @@ class ManagerInterface const std::vector<uint8_t>& data) = 0; virtual bool deleteBlob(const std::string& path) = 0; + + virtual bool writeMeta(uint16_t session, uint32_t offset, + const std::vector<uint8_t>& data) = 0; }; /** @@ -192,6 +195,17 @@ class BlobManager : public ManagerInterface bool deleteBlob(const std::string& path) override; /** + * Attempt to write Metadata to a blob. + * + * @param[in] session - the session for this command. + * @param[in] offset - the offset into the blob to write. + * @param[in] data - the bytes to write to the blob. + * @return bool - true if the write succeeded. + */ + bool writeMeta(uint16_t session, uint32_t offset, + const std::vector<uint8_t>& data) override; + + /** * Attempts to return a valid unique session id. * * @param[in,out] - pointer to the session. diff --git a/blobs-ipmid/test/blob_mock.hpp b/blobs-ipmid/test/blob_mock.hpp index 3396048..b70d3d1 100644 --- a/blobs-ipmid/test/blob_mock.hpp +++ b/blobs-ipmid/test/blob_mock.hpp @@ -19,6 +19,8 @@ class BlobMock : public GenericBlobInterface MOCK_METHOD3(open, bool(uint16_t, uint16_t, const std::string&)); MOCK_METHOD3(read, std::vector<uint8_t>(uint16_t, uint32_t, uint32_t)); MOCK_METHOD3(write, bool(uint16_t, uint32_t, const std::vector<uint8_t>&)); + MOCK_METHOD3(writeMeta, + bool(uint16_t, uint32_t, const std::vector<uint8_t>&)); MOCK_METHOD2(commit, bool(uint16_t, const std::vector<uint8_t>&)); MOCK_METHOD1(close, bool(uint16_t)); MOCK_METHOD2(stat, bool(uint16_t, struct BlobMeta*)); diff --git a/blobs-ipmid/test/manager_mock.hpp b/blobs-ipmid/test/manager_mock.hpp index a4714f8..00eeb6b 100644 --- a/blobs-ipmid/test/manager_mock.hpp +++ b/blobs-ipmid/test/manager_mock.hpp @@ -26,6 +26,8 @@ class ManagerMock : public ManagerInterface MOCK_METHOD3(read, std::vector<uint8_t>(uint16_t, uint32_t, uint32_t)); MOCK_METHOD3(write, bool(uint16_t, uint32_t, const std::vector<uint8_t>&)); MOCK_METHOD1(deleteBlob, bool(const std::string&)); + MOCK_METHOD3(writeMeta, + bool(uint16_t, uint32_t, const std::vector<uint8_t>&)); }; /* |