From b4e02fcc78a130030917b43323fd8e55641a43ea Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 3 Sep 2024 16:24:47 -0700 Subject: [PATCH] shaping: validate the default shaping.toml file We used to do this as part of a more structured test, but decoupled that from the test case outcome in 899178351af562d0804ef5a4458c71ee08a892cd. This commit explicitly loads the default file to make sure that it is valid. --- assets/policy-extras/shaping.toml | 3 +-- crates/kumo-api-types/src/shaping.rs | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/policy-extras/shaping.toml b/assets/policy-extras/shaping.toml index 81a16500..1d0a7e25 100644 --- a/assets/policy-extras/shaping.toml +++ b/assets/policy-extras/shaping.toml @@ -90,8 +90,7 @@ duration = "30 days" match=[ {MXSuffix=".google.com"}, {MXSuffix=".googlemail.com"} - ] - +] max_deliveries_per_connection = 50 provider_connection_limit = 5 consecutive_connection_failures_before_delay = 5 diff --git a/crates/kumo-api-types/src/shaping.rs b/crates/kumo-api-types/src/shaping.rs index a946d1ee..26218b92 100644 --- a/crates/kumo-api-types/src/shaping.rs +++ b/crates/kumo-api-types/src/shaping.rs @@ -1917,4 +1917,11 @@ MergedEntry { "# ); } + + #[tokio::test] + async fn test_load_default_shaping_toml() { + Shaping::merge_files(&["../../assets/policy-extras/shaping.toml".into()]) + .await + .unwrap(); + } }