feat(loadtest): sync add real 500-session capacity harness
This commit is contained in:
parent
ac0566f779
commit
141f2f20c4
39 changed files with 4157 additions and 42 deletions
|
|
@ -18,3 +18,31 @@ func TestBuildConfigIncludesDefaultReaction(t *testing.T) {
|
|||
t.Fatalf("reactions_default = %#v, want %q emoji", reaction, DefaultReactionEmoticon)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildConfigAdvertisesCanonicalPrimaryDC(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
ip string
|
||||
want string
|
||||
ipv6 bool
|
||||
}{
|
||||
{name: "ipv4", ip: "192.0.2.10", want: "192.0.2.10"},
|
||||
{name: "ipv6", ip: "2001:0db8::1", want: "2001:db8::1", ipv6: true},
|
||||
{name: "mapped ipv4", ip: "::ffff:192.0.2.10", want: "192.0.2.10"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
config := BuildConfig(2, tt.ip, 2398, time.Unix(1, 0), "https://telesrv.net")
|
||||
if len(config.DCOptions) != 1 {
|
||||
t.Fatalf("len(DCOptions) = %d, want 1", len(config.DCOptions))
|
||||
}
|
||||
option := config.DCOptions[0]
|
||||
if option.ID != 2 || option.IPAddress != tt.want || option.Port != 2398 || option.Ipv6 != tt.ipv6 {
|
||||
t.Fatalf("DCOptions[0] = %+v, want dc=2 ip=%q port=2398 ipv6=%v", option, tt.want, tt.ipv6)
|
||||
}
|
||||
if option.MediaOnly || option.CDN || option.TCPObfuscatedOnly || option.Static || option.ThisPortOnly {
|
||||
t.Fatalf("DCOptions[0] has unexpected restrictive flags: %+v", option)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue