forked from Deuxfleurs/garage
garage(tests): Remove RNG stuff
This commit is contained in:
parent
2bb0f4613f
commit
71496c9f4e
4 changed files with 1 additions and 17 deletions
|
@ -985,7 +985,6 @@ in
|
||||||
devDependencies = {
|
devDependencies = {
|
||||||
aws_sdk_s3 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".aws-sdk-s3."0.6.0" { inherit profileName; };
|
aws_sdk_s3 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".aws-sdk-s3."0.6.0" { inherit profileName; };
|
||||||
http = rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.5" { inherit profileName; };
|
http = rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.5" { inherit profileName; };
|
||||||
rand = rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.4" { inherit profileName; };
|
|
||||||
static_init = rustPackages."registry+https://github.com/rust-lang/crates.io-index".static_init."1.0.2" { inherit profileName; };
|
static_init = rustPackages."registry+https://github.com/rust-lang/crates.io-index".static_init."1.0.2" { inherit profileName; };
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -56,5 +56,4 @@ netapp = "0.3.0"
|
||||||
aws-sdk-s3 = "0.6"
|
aws-sdk-s3 = "0.6"
|
||||||
http = "0.2"
|
http = "0.2"
|
||||||
|
|
||||||
rand = "0.8"
|
|
||||||
static_init = "1.0"
|
static_init = "1.0"
|
||||||
|
|
|
@ -7,7 +7,6 @@ pub mod macros;
|
||||||
pub mod client;
|
pub mod client;
|
||||||
pub mod ext;
|
pub mod ext;
|
||||||
pub mod garage;
|
pub mod garage;
|
||||||
pub mod util;
|
|
||||||
|
|
||||||
const REGION: Region = Region::from_static("garage-integ-test");
|
const REGION: Region = Region::from_static("garage-integ-test");
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ impl Context {
|
||||||
///
|
///
|
||||||
/// Return the created bucket full name.
|
/// Return the created bucket full name.
|
||||||
pub fn create_bucket(&self, name: &str) -> String {
|
pub fn create_bucket(&self, name: &str) -> String {
|
||||||
let bucket_name = format!("{}-{}", name, util::random_id(6));
|
let bucket_name = name.to_owned();
|
||||||
|
|
||||||
self.garage
|
self.garage
|
||||||
.command()
|
.command()
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
pub fn random_id(len: usize) -> String {
|
|
||||||
use rand::distributions::Slice;
|
|
||||||
use rand::Rng;
|
|
||||||
|
|
||||||
static ALPHABET: &[u8] = b"abcdefghijklmnopqrstuvwxyz0123456789.";
|
|
||||||
|
|
||||||
let rng = rand::thread_rng();
|
|
||||||
rng.sample_iter(Slice::new(ALPHABET).unwrap())
|
|
||||||
.map(|b| char::from(*b))
|
|
||||||
.filter(|c| c.is_ascii_lowercase() || c.is_ascii_digit())
|
|
||||||
.take(len)
|
|
||||||
.collect()
|
|
||||||
}
|
|
Loading…
Reference in a new issue