Fix nginx ingress unittests.
This commit is contained in:
parent
e049275a82
commit
7e8c051e2c
1 changed files with 7 additions and 7 deletions
|
@ -32,10 +32,10 @@ func getConfigNginxBool(data map[string]string) nginxConfiguration {
|
||||||
|
|
||||||
func TestManagerReadConfigBoolFalse(t *testing.T) {
|
func TestManagerReadConfigBoolFalse(t *testing.T) {
|
||||||
configNginx := getConfigNginxBool(map[string]string{
|
configNginx := getConfigNginxBool(map[string]string{
|
||||||
"hts-include-subdomains": "false",
|
"hsts-include-subdomains": "false",
|
||||||
"use-proxy-protocol": "false",
|
"use-proxy-protocol": "false",
|
||||||
})
|
})
|
||||||
if configNginx.HTSIncludeSubdomains {
|
if configNginx.HSTSIncludeSubdomains {
|
||||||
t.Error("Failed to config boolean value (default true) to false")
|
t.Error("Failed to config boolean value (default true) to false")
|
||||||
}
|
}
|
||||||
if configNginx.UseProxyProtocol {
|
if configNginx.UseProxyProtocol {
|
||||||
|
@ -45,10 +45,10 @@ func TestManagerReadConfigBoolFalse(t *testing.T) {
|
||||||
|
|
||||||
func TestManagerReadConfigBoolTrue(t *testing.T) {
|
func TestManagerReadConfigBoolTrue(t *testing.T) {
|
||||||
configNginx := getConfigNginxBool(map[string]string{
|
configNginx := getConfigNginxBool(map[string]string{
|
||||||
"hts-include-subdomains": "true",
|
"hsts-include-subdomains": "true",
|
||||||
"use-proxy-protocol": "true",
|
"use-proxy-protocol": "true",
|
||||||
})
|
})
|
||||||
if !configNginx.HTSIncludeSubdomains {
|
if !configNginx.HSTSIncludeSubdomains {
|
||||||
t.Error("Failed to config boolean value (default true) to true")
|
t.Error("Failed to config boolean value (default true) to true")
|
||||||
}
|
}
|
||||||
if !configNginx.UseProxyProtocol {
|
if !configNginx.UseProxyProtocol {
|
||||||
|
@ -60,7 +60,7 @@ func TestManagerReadConfigBoolNothing(t *testing.T) {
|
||||||
configNginx := getConfigNginxBool(map[string]string{
|
configNginx := getConfigNginxBool(map[string]string{
|
||||||
"invaild-key": "true",
|
"invaild-key": "true",
|
||||||
})
|
})
|
||||||
if !configNginx.HTSIncludeSubdomains {
|
if !configNginx.HSTSIncludeSubdomains {
|
||||||
t.Error("Failed to get default boolean value true")
|
t.Error("Failed to get default boolean value true")
|
||||||
}
|
}
|
||||||
if configNginx.UseProxyProtocol {
|
if configNginx.UseProxyProtocol {
|
||||||
|
|
Loading…
Reference in a new issue