aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/common/mod.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-03-13 17:26:21 +0000
committerAlex <alex@adnab.me>2023-03-13 17:26:21 +0000
commitd6ffa57f4054c41c37a06686330e0080f8243430 (patch)
treee41175c99bee2bb6cc416f2b843fe55cf2c3ad98 /src/garage/tests/common/mod.rs
parent7fcc153e7cfbae61626ca288634a0f4fb4c4b709 (diff)
parent70b5424b9987ca348a1da97cc1827e2286bbfe4b (diff)
downloadgarage-d6ffa57f4054c41c37a06686330e0080f8243430.tar.gz
garage-d6ffa57f4054c41c37a06686330e0080f8243430.zip
Merge pull request 'Increase Garage tests robustness' (#526) from tests/increase-robustness into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/526 Reviewed-by: Alex <alex@adnab.me> Reviewed-by: trinity-1686a <trinity.pointard@gmail.com>
Diffstat (limited to 'src/garage/tests/common/mod.rs')
-rw-r--r--src/garage/tests/common/mod.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/garage/tests/common/mod.rs b/src/garage/tests/common/mod.rs
index 28874b02..eca3e42b 100644
--- a/src/garage/tests/common/mod.rs
+++ b/src/garage/tests/common/mod.rs
@@ -13,13 +13,16 @@ use custom_requester::CustomRequester;
const REGION: Region = Region::from_static("garage-integ-test");
+#[derive(Clone)]
pub struct Context {
pub garage: &'static garage::Instance,
+ pub key: garage::Key,
pub client: Client,
pub custom_request: CustomRequester,
pub k2v: K2VContext,
}
+#[derive(Clone)]
pub struct K2VContext {
pub request: CustomRequester,
}
@@ -27,13 +30,15 @@ pub struct K2VContext {
impl Context {
fn new() -> Self {
let garage = garage::instance();
- let client = client::build_client(garage);
- let custom_request = CustomRequester::new_s3(garage);
- let k2v_request = CustomRequester::new_k2v(garage);
+ let key = garage.key(None);
+ let client = client::build_client(garage, &key);
+ let custom_request = CustomRequester::new_s3(garage, &key);
+ let k2v_request = CustomRequester::new_k2v(garage, &key);
Context {
garage,
client,
+ key,
custom_request,
k2v: K2VContext {
request: k2v_request,
@@ -57,7 +62,7 @@ impl Context {
.args(["bucket", "allow"])
.args(["--owner", "--read", "--write"])
.arg(&bucket_name)
- .args(["--key", &self.garage.key.name])
+ .args(["--key", &self.key.id])
.quiet()
.expect_success_status("Could not allow key for bucket");