]> git.proxmox.com Git - ceph.git/blob - ceph/src/test/librbd/mock/crypto/MockCryptoInterface.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / test / librbd / mock / crypto / MockCryptoInterface.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_TEST_LIBRBD_MOCK_CRYPTO_MOCK_CRYPTO_INTERFACE_H
5 #define CEPH_TEST_LIBRBD_MOCK_CRYPTO_MOCK_CRYPTO_INTERFACE_H
6
7 #include "include/buffer.h"
8 #include "gmock/gmock.h"
9 #include "librbd/crypto/CryptoInterface.h"
10
11 namespace librbd {
12 namespace crypto {
13
14 struct MockCryptoInterface : CryptoInterface {
15
16 MOCK_METHOD2(encrypt, int(ceph::bufferlist*, uint64_t));
17 MOCK_METHOD2(decrypt, int(ceph::bufferlist*, uint64_t));
18 MOCK_CONST_METHOD0(get_key, const unsigned char*());
19 MOCK_CONST_METHOD0(get_key_length, int());
20
21 uint64_t get_block_size() const override {
22 return 4096;
23 }
24
25 uint64_t get_data_offset() const override {
26 return 4 * 1024 * 1024;
27 }
28 };
29
30 } // namespace crypto
31 } // namespace librbd
32
33 #endif // CEPH_TEST_LIBRBD_MOCK_CRYPTO_MOCK_CRYPTO_INTERFACE_H