aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/Cargo.toml1
-rw-r--r--src/garage/tests/common/client.rs2
-rw-r--r--src/garage/tests/s3/objects.rs23
3 files changed, 19 insertions, 7 deletions
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index 5860cf97..966c8ac5 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -71,6 +71,7 @@ hyper-util.workspace = true
mktemp.workspace = true
sha2.workspace = true
+
static_init.workspace = true
assert-json-diff.workspace = true
serde_json.workspace = true
diff --git a/src/garage/tests/common/client.rs b/src/garage/tests/common/client.rs
index ffa4cae8..7a6612cb 100644
--- a/src/garage/tests/common/client.rs
+++ b/src/garage/tests/common/client.rs
@@ -12,7 +12,7 @@ pub fn build_client(key: &Key) -> Client {
.endpoint_url(format!("http://127.0.0.1:{}", DEFAULT_PORT))
.region(super::REGION)
.credentials_provider(credentials)
- .behavior_version(BehaviorVersion::v2023_11_09())
+ .behavior_version(BehaviorVersion::v2024_03_28())
.build();
Client::from_conf(config)
diff --git a/src/garage/tests/s3/objects.rs b/src/garage/tests/s3/objects.rs
index 77eca2b1..dfc5253d 100644
--- a/src/garage/tests/s3/objects.rs
+++ b/src/garage/tests/s3/objects.rs
@@ -189,12 +189,14 @@ async fn test_getobject() {
#[tokio::test]
async fn test_metadata() {
+ use aws_sdk_s3::primitives::{DateTime, DateTimeFormat};
+
let ctx = common::context();
let bucket = ctx.create_bucket("testmetadata");
let etag = "\"46cf18a9b447991b450cad3facf5937e\"";
- let exp = aws_sdk_s3::primitives::DateTime::from_secs(10000000000);
- let exp2 = aws_sdk_s3::primitives::DateTime::from_secs(10000500000);
+ let exp = DateTime::from_secs(10000000000);
+ let exp2 = DateTime::from_secs(10000500000);
{
// Note. The AWS client SDK adds a Content-Type header
@@ -227,7 +229,7 @@ async fn test_metadata() {
assert_eq!(o.content_disposition, None);
assert_eq!(o.content_encoding, None);
assert_eq!(o.content_language, None);
- assert_eq!(o.expires, None);
+ assert_eq!(o.expires_string, None);
assert_eq!(o.metadata.unwrap_or_default().len(), 0);
let o = ctx
@@ -250,7 +252,10 @@ async fn test_metadata() {
assert_eq!(o.content_disposition.unwrap().as_str(), "cddummy");
assert_eq!(o.content_encoding.unwrap().as_str(), "cedummy");
assert_eq!(o.content_language.unwrap().as_str(), "cldummy");
- assert_eq!(o.expires.unwrap(), exp);
+ assert_eq!(
+ o.expires_string.unwrap(),
+ exp.fmt(DateTimeFormat::HttpDate).unwrap()
+ );
}
{
@@ -288,7 +293,10 @@ async fn test_metadata() {
assert_eq!(o.content_disposition.unwrap().as_str(), "cdtest");
assert_eq!(o.content_encoding.unwrap().as_str(), "cetest");
assert_eq!(o.content_language.unwrap().as_str(), "cltest");
- assert_eq!(o.expires.unwrap(), exp2);
+ assert_eq!(
+ o.expires_string.unwrap(),
+ exp2.fmt(DateTimeFormat::HttpDate).unwrap()
+ );
let mut meta = o.metadata.unwrap();
assert_eq!(meta.remove("testmeta").unwrap(), "hello people");
assert_eq!(meta.remove("nice-unicode-meta").unwrap(), "宅配便");
@@ -314,7 +322,10 @@ async fn test_metadata() {
assert_eq!(o.content_disposition.unwrap().as_str(), "cddummy");
assert_eq!(o.content_encoding.unwrap().as_str(), "cedummy");
assert_eq!(o.content_language.unwrap().as_str(), "cldummy");
- assert_eq!(o.expires.unwrap(), exp);
+ assert_eq!(
+ o.expires_string.unwrap(),
+ exp.fmt(DateTimeFormat::HttpDate).unwrap()
+ );
}
}