You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
876 B
25 lines
876 B
package main
|
|
|
|
import "testing"
|
|
|
|
func TestRunLoadProfileCoversProductAttachmentBudgets(t *testing.T) {
|
|
for _, attachments := range []int{1, 48, 96, 192} {
|
|
evidence, err := runLoadProfile(attachments, 32)
|
|
if err != nil {
|
|
t.Fatalf("runLoadProfile(%d): %v", attachments, err)
|
|
}
|
|
expectedChannels := 48
|
|
if attachments == 1 {
|
|
expectedChannels = 1
|
|
}
|
|
if evidence.ActiveAttachments != attachments || evidence.ActiveChannels != expectedChannels {
|
|
t.Fatalf("profile %d evidence = %#v", attachments, evidence)
|
|
}
|
|
if evidence.QueuedBytes != uint64(attachments*32) || evidence.TransportReconnects < 1 {
|
|
t.Fatalf("profile %d queue/reconnect evidence = %#v", attachments, evidence)
|
|
}
|
|
if evidence.ResidentBytes == 0 || evidence.CPUSeconds < 0 || evidence.WallMilliseconds < 0 {
|
|
t.Fatalf("profile %d resource evidence = %#v", attachments, evidence)
|
|
}
|
|
}
|
|
}
|
|
|