aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/common/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/garage/tests/common/client.rs')
-rw-r--r--src/garage/tests/common/client.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/garage/tests/common/client.rs b/src/garage/tests/common/client.rs
new file mode 100644
index 00000000..c5ddc6e5
--- /dev/null
+++ b/src/garage/tests/common/client.rs
@@ -0,0 +1,22 @@
+use aws_sdk_s3::{Client, Config, Credentials, Endpoint};
+
+use super::garage::Instance;
+
+pub fn build_client(instance: &Instance) -> Client {
+ let credentials = Credentials::new(
+ &instance.key.id,
+ &instance.key.secret,
+ None,
+ None,
+ "garage-integ-test",
+ );
+ let endpoint = Endpoint::immutable(instance.uri());
+
+ let config = Config::builder()
+ .region(super::REGION)
+ .credentials_provider(credentials)
+ .endpoint_resolver(endpoint)
+ .build();
+
+ Client::from_conf(config)
+}