#vault #hashi-corp #testing

vaulltrs-test

用于测试Hashicorp Vault服务器的测试套件

4 个版本

0.2.2 2021年9月11日
0.2.1 2021年9月10日
0.2.0 2021年9月9日
0.1.0 2021年9月9日

身份验证 中排名 #999

每月下载 22
vaultssh 中使用

MIT 许可证

14KB
212

vaulltrs-test

用于测试Hashicorp Vault服务器的测试套件。

安装

vaulltrs-test 添加到 cargo.toml 中的开发依赖项

[dev-dependencies]
vaultrs-test = "0.1.0"

使用

use vaultrs_test::docker::{Server, ServerConfig};
use vaultrs_test::{VaultServer, VaultServerConfig};

// Configures a container to run Vault server v1.8.2
let config = VaultServerConfig::default(Some("1.8.2"));

// Creates a test instance to run the container in
let instance = config.to_instance();

// Runs the test instance, passing in details about the container environment
instance.run(|ops| async move {
    // The code below only runs after the container is verified running

    // Creates an abstraction for interacting with the Vault container
    let server = VaultServer::new(&ops, &config);

    // Run test code against container
})

// Container is cleaned up at this point

测试

使用 cargo 运行测试

cargo test

依赖项

~20–35MB
~618K SLoC