补充SMTP中继开关测试夹具

更新测试场景,明确只有显式启用中继时才校验和投递,验证旧配置不再自动启用。
This commit is contained in:
xuans committed 2026-10-06 00:32:43 +08:00
1 parent bbad2bcc6b
commit 4b802b5d11
5 files changed
+23 -21

No files matched your search

+7 -5
View File
@@ -439,6 +439,7 @@ func TestConfigManagerMailSectionAppliesBothPartitionsWithoutMailFile(t *testing
t.Fatal(err)
}
runtime.SMTP.Relay = SMTPConfig{
RelayEnabled: true,
RelayHost: "smtp.example.com",
RelayPort: 587,
Username: "relay-user",
@@ -1046,11 +1047,12 @@ func TestConfigManagerSecretClearRequiresExplicitConfirmation(t *testing.T) {
root := t.TempDir()
runtime := validRuntimeConfig()
runtime.SMTP.Relay = SMTPConfig{
RelayHost: "smtp.example.com",
RelayPort: 587,
Security: "starttls",
From: "no-reply@example.com",
FromDomain: "example.com",
RelayEnabled: true,
RelayHost: "smtp.example.com",
RelayPort: 587,
Security: "starttls",
From: "no-reply@example.com",
FromDomain: "example.com",
}
writeRuntimeFixture(t, root, runtime)
options := ConfigLoaderOptions{Validation: RuntimeValidationOptions{HasSuperAdmin: true, Production: true}}