#vault #test #hashicorp

vaultrs-test

A test suite for testing against Hashicorp Vault servers

4 releases

0.2.2 Sep 11, 2021
0.2.1 Sep 10, 2021
0.2.0 Sep 9, 2021
0.1.0 Sep 9, 2021

#5 in #hashicorp

Download history 5/week @ 2022-01-29 3/week @ 2022-02-05 4/week @ 2022-02-12 8/week @ 2022-02-19 4/week @ 2022-02-26 5/week @ 2022-03-05 13/week @ 2022-03-12 18/week @ 2022-03-19 5/week @ 2022-03-26 6/week @ 2022-04-02 9/week @ 2022-04-09 8/week @ 2022-04-16 13/week @ 2022-04-23 31/week @ 2022-04-30 36/week @ 2022-05-07 72/week @ 2022-05-14

152 downloads per month
Used in vaultssh

MIT license

14KB
212 lines

vaultrs-test

A test suite for testing against Hashicorp Vault servers.

Installation

Add vaultrs-test as a developemnt depdendency to your cargo.toml:

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

Usage

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

Testing

Run tests with cargo:

cargo test

Dependencies

~17–26MB
~562K SLoC