Skip to content

Commit 49398f1

Browse files
pengzhoumlPeng Zhou
and
Peng Zhou
authored
MLE-14412: Fix TLS test failure in pipeline (#240)
* tesing update * MLE-14412 TLS Testing failed with Jenkins * test TLS only * Fix lint issue * fix lint issue * enable all tests --------- Co-authored-by: Peng Zhou <[email protected]>
1 parent 0b1b0f8 commit 49398f1

File tree

4 files changed

+44
-21
lines changed

4 files changed

+44
-21
lines changed

test/e2e/tls_test.go

+44-9
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,30 @@ func TestTLSEnabledWithSelfSigned(t *testing.T) {
2727
if e != nil {
2828
t.Fatalf(e.Error())
2929
}
30+
imageRepo, repoPres := os.LookupEnv("dockerRepository")
31+
imageTag, tagPres := os.LookupEnv("dockerVersion")
3032
username := "admin"
3133
password := "admin"
3234

35+
if !repoPres {
36+
imageRepo = "marklogicdb/marklogic-db"
37+
t.Logf("No imageRepo variable present, setting to default value: " + imageRepo)
38+
}
39+
40+
if !tagPres {
41+
imageTag = "latest"
42+
t.Logf("No imageTag variable present, setting to default value: " + imageTag)
43+
}
44+
3345
namespaceName := "marklogic-" + strings.ToLower(random.UniqueId())
3446
kubectlOptions := k8s.NewKubectlOptions("", "", namespaceName)
3547
options := &helm.Options{
3648
KubectlOptions: kubectlOptions,
3749
SetValues: map[string]string{
3850
"persistence.enabled": "false",
3951
"replicaCount": "1",
40-
"image.repository": "marklogicdb/marklogic-db",
41-
"image.tag": "latest",
52+
"image.repository": imageRepo,
53+
"image.tag": imageTag,
4254
"auth.adminUsername": username,
4355
"auth.adminPassword": password,
4456
"logCollection.enabled": "false",
@@ -131,10 +143,25 @@ func TestTLSEnabledWithNamedCert(t *testing.T) {
131143
namespaceName := "marklogic-" + "tlsnamed"
132144
kubectlOptions := k8s.NewKubectlOptions("", "", namespaceName)
133145
var err error
146+
imageRepo, repoPres := os.LookupEnv("dockerRepository")
147+
imageTag, tagPres := os.LookupEnv("dockerVersion")
148+
if !repoPres {
149+
imageRepo = "marklogicdb/marklogic-db"
150+
t.Logf("No imageRepo variable present, setting to default value: " + imageRepo)
151+
}
152+
153+
if !tagPres {
154+
imageTag = "latest"
155+
t.Logf("No imageTag variable present, setting to default value: " + imageTag)
156+
}
134157

135158
// Setup the args for helm install using custom values.yaml file
136159
options := &helm.Options{
137-
ValuesFiles: []string{"../test_data/values/tls_twonode_values.yaml"},
160+
ValuesFiles: []string{"../test_data/values/tls_twonode_values.yaml"},
161+
SetValues: map[string]string{
162+
"image.repository": imageRepo,
163+
"image.tag": imageTag,
164+
},
138165
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
139166
}
140167

@@ -316,17 +343,21 @@ func TestTlsOnEDnode(t *testing.T) {
316343
}
317344

318345
if !repoPres {
319-
imageRepo = "marklogic-centos/marklogic-server-centos"
346+
imageRepo = "marklogicdb/marklogic-db"
320347
t.Logf("No imageRepo variable present, setting to default value: " + imageRepo)
321348
}
322349

323350
if !tagPres {
324-
imageTag = "10-internal"
351+
imageTag = "latest"
325352
t.Logf("No imageTag variable present, setting to default value: " + imageTag)
326353
}
327354

328355
options := &helm.Options{
329-
ValuesFiles: []string{"../test_data/values/tls_dnode_values.yaml"},
356+
ValuesFiles: []string{"../test_data/values/tls_dnode_values.yaml"},
357+
SetValues: map[string]string{
358+
"image.repository": imageRepo,
359+
"image.tag": imageTag,
360+
},
330361
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
331362
}
332363

@@ -415,7 +446,11 @@ func TestTlsOnEDnode(t *testing.T) {
415446

416447
enodeOptions := &helm.Options{
417448
KubectlOptions: kubectlOptions,
418-
ValuesFiles: []string{"../test_data/values/tls_enode_values.yaml"},
449+
SetValues: map[string]string{
450+
"image.repository": imageRepo,
451+
"image.tag": imageTag,
452+
},
453+
ValuesFiles: []string{"../test_data/values/tls_enode_values.yaml"},
419454
}
420455

421456
//generate certificates for enode pod zero
@@ -440,7 +475,7 @@ func TestTlsOnEDnode(t *testing.T) {
440475
helm.Install(t, enodeOptions, helmChartPath, enodeReleaseName)
441476

442477
// wait until the first enode pod is in Ready status
443-
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName0, 45, 20*time.Second)
478+
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName0, 20, 20*time.Second)
444479

445480
t.Log("====Verify xdqp-ssl-enabled is set to false on Enode")
446481
resp, err = client.R().
@@ -473,7 +508,7 @@ func TestTlsOnEDnode(t *testing.T) {
473508
}
474509

475510
// wait until the second enode pod is in Ready status
476-
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName1, 45, 20*time.Second)
511+
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName1, 20, 20*time.Second)
477512

478513
t.Log("====Verifying two hosts joined enode group")
479514
enodeHostCount := 0

test/test_data/values/tls_dnode_values.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ replicaCount: 1
1313
persistence:
1414
enabled: true
1515

16-
image:
17-
repository: marklogicdb/marklogic-db
18-
tag: latest
19-
2016
tls:
2117
enableOnDefaultAppServers: true
2218
certSecretNames:

test/test_data/values/tls_enode_values.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ replicaCount: 2
1515
persistence:
1616
enabled: true
1717

18-
image:
19-
repository: marklogicdb/marklogic-db
20-
tag: latest
21-
2218
tls:
2319
enableOnDefaultAppServers: true
2420
certSecretNames:

test/test_data/values/tls_twonode_values.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ replicaCount: 2
99
persistence:
1010
enabled: true
1111

12-
image:
13-
repository: marklogicdb/marklogic-db
14-
tag: latest
15-
1612
tls:
1713
enableOnDefaultAppServers: true
1814
certSecretNames:

0 commit comments

Comments
 (0)