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 21, 2024
1 parent 8bc94a6 commit f00d3c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,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 +232,17 @@ 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 _, c := range opt.CipherSuites {
for _, i := range tls.InsecureCipherSuites() {
if c == i.ID {
t.Errorf("Insecure cipher found in list: %s", i.Name)
}
}
}
}
}

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

0 comments on commit f00d3c1

Please sign in to comment.