Skip to content

Commit

Permalink
Test ToOption is a suite list with excluded suites
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Herrera <rickhl@outlook.com>
  • Loading branch information
rickhlx committed Jun 25, 2024
1 parent e0b34d4 commit fcad0f0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"os"
"reflect"
"slices"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -174,6 +175,7 @@ func TestToOptions(t *testing.T) {
c.ProxyPreserveHost = true // 4
c.RemoveHopHeaders = true // 16
c.RfcPatchPath = true // 32
c.ExcludeInsecureCipherSuites = true

// config
c.EtcdUrls = "127.0.0.1:5555"
Expand Down Expand Up @@ -231,6 +233,15 @@ func TestToOptions(t *testing.T) {
if len(opt.EditRoute) != 1 {
t.Errorf("Failed to get expected edit route: %s", c.EditRoute)
}
if opt.CipherSuites == nil {
t.Errorf("Failed to get the filtered cipher suites")
} else {
for _, i := range tls.InsecureCipherSuites() {
if slices.Contains(opt.CipherSuites, i.ID) {
t.Errorf("Insecure cipher found in list: %s", i.Name)
}
}
}
}

func Test_Validate(t *testing.T) {
Expand Down

0 comments on commit fcad0f0

Please sign in to comment.