A test suite for testing against Hashicorp Vault servers.
Add vaultrs-test
as a developemnt depdendency to your cargo.toml:
[dev-dependencies]
vaultrs = "0.1.0"
```rust use vaultrstest::docker::{Server, ServerConfig}; use vaultrstest::{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 // The code below only runs after the container is verified running instance.run(|ops| async move { // Creates an abstraction for interacting with the Vault container let server = VaultServer::new(&ops, &config);
// Verify server is ready for requests
let status = server.client.status().await;
assert!(matches! { status, vaultrs::sys::ServerStatus::OK });
})
// Container is cleaned up at this point ```
Run tests with cargo:
cargo test
Check out the issues for items neeeding attention or submit your own and then: