Add _grpc_config replies

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2020-03-30 09:09:34 +02:00
parent 36dec4ca85
commit e2238cfad8
5 changed files with 33 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package traffic
import (
"encoding/json"
"testing"
"github.com/caddyserver/caddy"
@@ -13,6 +14,16 @@ func TestSetup(t *testing.T) {
}
}
func TestLBTxt(t *testing.T) {
_, err := json.Marshal(lbTXT)
if err != nil {
t.Fatalf("Failed to marshal grpc serverConfig: %s", err)
}
if len(lbTXT) > 255 {
t.Fatalf("Too long grpc serverConfig (>255): %d", len(lbTXT))
}
}
func TestParseTraffic(t *testing.T) {
tests := []struct {
input string