mirror of https://github.com/facebook/rocksdb.git
Support to use environment variable to test customer encryption plugins (#12025)
Summary: The CreateEnvTest.CreateEncryptedFileSystem unit test is to verify the creation functionality of EncryptedFileSystem, but now it just support the builtin CTREncryptionProvider class. This patch make it flexible to use environment variable `TEST_FS_URI`, it is useful to test customer encryption plugins. Pull Request resolved: https://github.com/facebook/rocksdb/pull/12025 Reviewed By: anand1976 Differential Revision: D50799656 Pulled By: ajkr fbshipit-source-id: dbcacfefbf07de9c7803f7707b34c5193bec17bf
This commit is contained in:
parent
e90e9825b4
commit
c4c62c2304
|
@ -2906,6 +2906,13 @@ TEST_F(CreateEnvTest, CreateEncryptedFileSystem) {
|
||||||
|
|
||||||
std::string base_opts =
|
std::string base_opts =
|
||||||
std::string("provider=1://test; id=") + EncryptedFileSystem::kClassName();
|
std::string("provider=1://test; id=") + EncryptedFileSystem::kClassName();
|
||||||
|
// Rewrite the default FileSystem URI if the "TEST_FS_URI" environment
|
||||||
|
// variable is set. This is useful to test customer encryption plugins.
|
||||||
|
const char* uri = getenv("TEST_FS_URI");
|
||||||
|
if (uri != nullptr) {
|
||||||
|
base_opts = uri;
|
||||||
|
}
|
||||||
|
|
||||||
// The EncryptedFileSystem requires a "provider" option.
|
// The EncryptedFileSystem requires a "provider" option.
|
||||||
ASSERT_NOK(FileSystem::CreateFromString(
|
ASSERT_NOK(FileSystem::CreateFromString(
|
||||||
config_options_, EncryptedFileSystem::kClassName(), &fs));
|
config_options_, EncryptedFileSystem::kClassName(), &fs));
|
||||||
|
|
Loading…
Reference in New Issue