aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/simple.rs
diff options
context:
space:
mode:
authorJill <kokakiwi@deuxfleurs.fr>2022-02-02 15:35:52 +0100
committerJill <kokakiwi@deuxfleurs.fr>2022-02-02 15:35:52 +0100
commit539b25652502693fed311699829f3bd28e604aa5 (patch)
tree031fb891d26630c87beca6f7ac67d21c65f6d440 /src/garage/tests/simple.rs
parentf67029ce2af2f8870836d5bb908254d7fdbbe71b (diff)
downloadgarage-539b25652502693fed311699829f3bd28e604aa5.tar.gz
garage-539b25652502693fed311699829f3bd28e604aa5.zip
tests: Add garage integration tests (base)
Diffstat (limited to 'src/garage/tests/simple.rs')
-rw-r--r--src/garage/tests/simple.rs61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/garage/tests/simple.rs b/src/garage/tests/simple.rs
new file mode 100644
index 00000000..a627c770
--- /dev/null
+++ b/src/garage/tests/simple.rs
@@ -0,0 +1,61 @@
+use crate::common;
+
+#[tokio::test]
+async fn test_simple() {
+ use aws_sdk_s3::ByteStream;
+
+ let ctx = common::context();
+ ctx.create_bucket("test-simple");
+
+ let data = ByteStream::from_static(b"Hello world!");
+
+ ctx.client
+ .put_object()
+ .bucket("test-simple")
+ .key("test")
+ .body(data)
+ .send()
+ .await
+ .unwrap();
+
+ let res = ctx
+ .client
+ .get_object()
+ .bucket("test-simple")
+ .key("test")
+ .send()
+ .await
+ .unwrap();
+
+ assert_bytes_eq!(res.body, b"Hello world!");
+}
+
+#[tokio::test]
+async fn test_simple_2() {
+ use aws_sdk_s3::ByteStream;
+
+ let ctx = common::context();
+ ctx.create_bucket("test-simple-2");
+
+ let data = ByteStream::from_static(b"Hello world!");
+
+ ctx.client
+ .put_object()
+ .bucket("test-simple-2")
+ .key("test")
+ .body(data)
+ .send()
+ .await
+ .unwrap();
+
+ let res = ctx
+ .client
+ .get_object()
+ .bucket("test-simple-2")
+ .key("test")
+ .send()
+ .await
+ .unwrap();
+
+ assert_bytes_eq!(res.body, b"Hello world!");
+}