test(mtproto): cover single-backend DC aliases
Follow up gramsrv PR #17 with boundary coverage and public configuration docs.
Canonical-Telesrv: b4df3e72c24470e4ce09e5fc1d46e0c2944f6d3e
Reviewed-Head: e7eb07b9eb
Co-authored-by: onysd <beatvin128@gmail.com>
This commit is contained in:
parent
5dcdb57e4c
commit
9ef746d45e
8 changed files with 127 additions and 69 deletions
|
|
@ -49,6 +49,34 @@ func TestLoadUsesExplicitAdvertiseIP(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestLoadStrictDCCheck(t *testing.T) {
|
||||
t.Run("defaults off", func(t *testing.T) {
|
||||
disableDefaultConfigFile(t)
|
||||
t.Setenv("TELESRV_STRICT_DC_CHECK", "")
|
||||
|
||||
cfg, err := Load()
|
||||
if err != nil {
|
||||
t.Fatalf("Load: %v", err)
|
||||
}
|
||||
if cfg.StrictDCCheck {
|
||||
t.Fatal("StrictDCCheck = true, want default false")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("explicitly enabled", func(t *testing.T) {
|
||||
disableDefaultConfigFile(t)
|
||||
t.Setenv("TELESRV_STRICT_DC_CHECK", "true")
|
||||
|
||||
cfg, err := Load()
|
||||
if err != nil {
|
||||
t.Fatalf("Load: %v", err)
|
||||
}
|
||||
if !cfg.StrictDCCheck {
|
||||
t.Fatal("StrictDCCheck = false, want true")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestLoadMTProtoAdmissionAndRPCBudgets(t *testing.T) {
|
||||
disableDefaultConfigFile(t)
|
||||
t.Setenv("TELESRV_MTPROTO_MAX_CONNECTIONS", "12345")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue