@@ -280,15 +280,20 @@ CSI Snapshot Controller Is Deployed
280
280
281
281
Openssl Connect Command
282
282
[Documentation] Run Openssl Connect Command in the remote server
283
- [Arguments] ${host_and_port } ${args }
283
+ [Arguments] ${host_and_port } ${args } ${ expected_rc } ${ expected_str }
284
284
${stdout } ${rc } = Execute Command
285
285
... openssl s_client -connect ${host_and_port } ${args } <<< "Q"
286
286
... sudo=True return_stdout=True return_stderr=False return_rc=True
287
- RETURN ${stdout } ${rc }
287
+ Should Be Equal As Integers ${rc } ${expected_rc }
288
+ IF "${rc } " == "0 " Should Contain ${stdout } ${expected_str }
288
289
289
290
Check TLS Endpoints
290
291
[Documentation] Run Openssl Connect Command to check k8s internal endpoints
291
292
[Arguments] ${return_code } ${tls_version } ${cipher }
293
+
294
+ ${cipher_available } = Is Cipher Available ${cipher }
295
+ IF ${cipher_available } == ${FALSE } RETURN
296
+
292
297
IF "${tls_version } " == "TLSv1.2"
293
298
Set Test Variable ${TLS_AND_CIPHER_ARGS } -tls1_2 -cipher ${cipher }
294
299
ELSE IF "${tls_version } " == "TLSv1.3"
@@ -297,15 +302,25 @@ Check TLS Endpoints
297
302
298
303
# api server, kubelet, kube controller manager and kube scheduler endpoint ports
299
304
FOR ${port } IN 6443 10250 10257 10259
300
- ${stdout } ${ rc } = Openssl Connect Command ${ USHIFT_HOST } : ${ port } ${ TLS_AND_CIPHER_ARGS }
301
- Should Be Equal As Integers ${ return_code } ${ rc }
302
- IF " ${ rc } " == " 0 "
303
- Should Contain ${ stdout } ${ tls_version } , Cipher is ${ cipher }
304
- END
305
+ ${stdout } = Wait Until Keyword Succeeds 10x 10s
306
+ ... Openssl Connect Command localhost: ${ port }
307
+ ... ${ TLS_AND_CIPHER_ARGS }
308
+ ... ${ return_code }
309
+ ... ${ tls_version } , Cipher is ${ cipher }
305
310
END
306
311
307
312
# etcd endpoint, need to use cert and key because etcd requires mTLS
308
313
Set Test Variable ${CERT_ARG } -cert ${APISERVER_ETCD_CLIENT_CERT } /client.crt
309
314
Set Test Variable ${KEY_ARG } -key ${APISERVER_ETCD_CLIENT_CERT } /client.key
310
- ${stdout } ${rc } = Openssl Connect Command localhost:2379 ${TLS_AND_CIPHER_ARGS } ${CERT_ARG } ${KEY_ARG }
311
- Should Be Equal As Integers ${return_code } ${rc }
315
+ Wait Until Keyword Succeeds 10x 2s
316
+ ... Openssl Connect Command localhost:2379
317
+ ... ${TLS_AND_CIPHER_ARGS } ${CERT_ARG } ${KEY_ARG }
318
+ ... ${return_code }
319
+ ... CONNECTED
320
+
321
+ Is Cipher Available
322
+ [Documentation] Check if openssl keywork is available from ssl list
323
+ [Arguments] ${cipher }
324
+ ${stdout } ${stderr } ${rc } = Execute Command openssl ciphers ${cipher }
325
+ ... sudo=True return_stdout=True return_stderr=True return_rc=True
326
+ IF "${rc } " == "0 " RETURN ${TRUE } ELSE RETURN ${FALSE }
0 commit comments