aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/common/mod.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-03-13 15:03:54 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-03-13 15:06:05 +0100
commit70b5424b9987ca348a1da97cc1827e2286bbfe4b (patch)
tree0940c4c1cdf8d19a7b346aa138d3f760c785cb1a /src/garage/tests/common/mod.rs
parent2687fb7fa80f645a2e29822d60e8970433788889 (diff)
downloadgarage-70b5424b9987ca348a1da97cc1827e2286bbfe4b.tar.gz
garage-70b5424b9987ca348a1da97cc1827e2286bbfe4b.zip
use one key per context to isolate teststests/increase-robustness
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");