@@ -56,6 +56,7 @@ func TestSeparateEDnode(t *testing.T) {
5656 "auth.adminUsername" : username ,
5757 "auth.adminPassword" : password ,
5858 "group.name" : "dnode" ,
59+ "group.enableXdqpSsl" : "true" ,
5960 "logCollection.enabled" : "false" ,
6061 },
6162 }
@@ -91,7 +92,6 @@ func TestSeparateEDnode(t *testing.T) {
9192 if err != nil {
9293 t .Fatalf (err .Error ())
9394 }
94- t .Logf ("Get hosts response:\n " + string (body ))
9595
9696 bootstrapHostJSON := gjson .Get (string (body ), `host-default-list.list-items.list-item.#(roleref="bootstrap").nameref` )
9797 t .Logf (`BootstrapHost: = %s` , bootstrapHostJSON )
@@ -100,6 +100,25 @@ func TestSeparateEDnode(t *testing.T) {
100100 t .Errorf ("Bootstrap does not exists on cluster" )
101101 }
102102
103+ t .Log ("====Verify xdqp-ssl-enabled is set to true" )
104+ endpoint := fmt .Sprintf ("http://%s/manage/v2/groups/dnode/properties?format=json" , tunnel .Endpoint ())
105+ t .Logf (`Endpoint for group properties: %s` , endpoint )
106+
107+ request := digestAuth .NewRequest (username , password , "GET" , endpoint , "" )
108+ resp , err = request .Execute ()
109+ if err != nil {
110+ t .Fatalf (err .Error ())
111+ }
112+ defer resp .Body .Close ()
113+ body , err = ioutil .ReadAll (resp .Body )
114+ if err != nil {
115+ t .Fatalf (err .Error ())
116+ }
117+
118+ xdqpSSLEnabled := gjson .Get (string (body ), `xdqp-ssl-enabled` )
119+ // verify xdqp-ssl-enabled is set to trues
120+ assert .Equal (t , true , xdqpSSLEnabled .Bool (), "xdqp-ssl-enabled should be set to true" )
121+
103122 enodeOptions := & helm.Options {
104123 KubectlOptions : kubectlOptions ,
105124 SetValues : map [string ]string {
@@ -111,6 +130,7 @@ func TestSeparateEDnode(t *testing.T) {
111130 "auth.adminPassword" : password ,
112131 "group.name" : "enode" ,
113132 "bootstrapHostName" : bootstrapHostJSON .Str ,
133+ "group.enableXdqpSsl" : "false" ,
114134 "logCollection.enabled" : "false" ,
115135 },
116136 }
@@ -120,6 +140,25 @@ func TestSeparateEDnode(t *testing.T) {
120140 // wait until the first enode pod is in Ready status
121141 k8s .WaitUntilPodAvailable (t , kubectlOptions , enodePodName0 , 45 , 20 * time .Second )
122142
143+ t .Log ("====Verify xdqp-ssl-enabled is set to false on Enode" )
144+ endpoint = fmt .Sprintf ("http://%s/manage/v2/groups/enode/properties?format=json" , tunnel .Endpoint ())
145+ t .Logf (`Endpoint for group properties: %s` , endpoint )
146+
147+ request = digestAuth .NewRequest (username , password , "GET" , endpoint , "" )
148+ resp , err = request .Execute ()
149+ if err != nil {
150+ t .Fatalf (err .Error ())
151+ }
152+ defer resp .Body .Close ()
153+ body , err = ioutil .ReadAll (resp .Body )
154+ if err != nil {
155+ t .Fatalf (err .Error ())
156+ }
157+
158+ xdqpSSLEnabled = gjson .Get (string (body ), `xdqp-ssl-enabled` )
159+ // verify xdqp-ssl-enabled is set to false
160+ assert .Equal (t , false , xdqpSSLEnabled .Bool ())
161+
123162 groupEndpoint := fmt .Sprintf ("http://%s/manage/v2/groups" , tunnel .Endpoint ())
124163 t .Logf (`Endpoint: %s` , groupEndpoint )
125164
@@ -132,7 +171,6 @@ func TestSeparateEDnode(t *testing.T) {
132171 if body , err = ioutil .ReadAll (resp .Body ); err != nil {
133172 t .Fatalf (err .Error ())
134173 }
135- t .Logf ("Groups status response:\n " + string (body ))
136174
137175 // verify groups dnode, enode exists on the cluster
138176 if ! strings .Contains (string (body ), "<nameref>dnode</nameref>" ) && ! strings .Contains (string (body ), "<nameref>enode</nameref>" ) {
0 commit comments