|
| 1 | +/* |
| 2 | +Copyright 2025 The Kubernetes Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package settings |
| 18 | + |
| 19 | +import ( |
| 20 | + "strings" |
| 21 | + |
| 22 | + "github.com/onsi/ginkgo/v2" |
| 23 | + |
| 24 | + "k8s.io/ingress-nginx/test/e2e/framework" |
| 25 | +) |
| 26 | + |
| 27 | +var _ = framework.DescribeSetting("ssl-session-cache", func() { |
| 28 | + f := framework.NewDefaultFramework("ssl-session-cache") |
| 29 | + |
| 30 | + ginkgo.It("should have default ssl_session_cache and ssl_session_timeout values", func() { |
| 31 | + f.WaitForNginxConfiguration(func(cfg string) bool { |
| 32 | + return strings.Contains(cfg, "ssl_session_cache shared:SSL:10m;") && |
| 33 | + strings.Contains(cfg, "ssl_session_timeout 10m;") |
| 34 | + }) |
| 35 | + }) |
| 36 | + |
| 37 | + ginkgo.It("should disable ssl_session_cache", func() { |
| 38 | + f.UpdateNginxConfigMapData("ssl-session-cache", "false") |
| 39 | + |
| 40 | + f.WaitForNginxConfiguration(func(cfg string) bool { |
| 41 | + return !strings.Contains(cfg, "ssl_session_cache") |
| 42 | + }) |
| 43 | + }) |
| 44 | + |
| 45 | + ginkgo.It("should set ssl_session_cache value", func() { |
| 46 | + f.UpdateNginxConfigMapData("ssl-session-cache-size", "20m") |
| 47 | + |
| 48 | + f.WaitForNginxConfiguration(func(cfg string) bool { |
| 49 | + return strings.Contains(cfg, "ssl_session_cache shared:SSL:20m;") |
| 50 | + }) |
| 51 | + }) |
| 52 | + |
| 53 | + ginkgo.It("should set ssl_session_timeout value", func() { |
| 54 | + f.UpdateNginxConfigMapData("ssl-session-timeout", "30m") |
| 55 | + |
| 56 | + f.WaitForNginxConfiguration(func(cfg string) bool { |
| 57 | + return strings.Contains(cfg, "ssl_session_timeout 30m;") |
| 58 | + }) |
| 59 | + }) |
| 60 | +}) |
0 commit comments