From adf8453de19529f611b09ad37a772c851e9b16c3 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 22 May 2024 11:15:08 +0200 Subject: [PATCH] chore: Add api.resource to wordpress.robot test file --- tests/wordpress.robot | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/wordpress.robot b/tests/wordpress.robot index f84e0dd..c717d6c 100644 --- a/tests/wordpress.robot +++ b/tests/wordpress.robot @@ -1,5 +1,6 @@ *** Settings *** Library SSHLibrary +Resource api.resource *** Test Cases *** Check if wordpress is installed correctly @@ -10,16 +11,30 @@ Check if wordpress is installed correctly Set Suite Variable ${module_id} ${output.module_id} Check if wordpress can be configured - ${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{}' + ${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"host":"wordpress.domain.org","http2https":true,"lets_encrypt":true}' ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 +Check postgresql path is configured + ${ocfg} = Run task module/${module_id}/get-configuration {} + Set Suite Variable ${HOST} ${ocfg['host']} + Set Suite Variable ${HTTP2HTTPS} ${ocfg['http2https']} + Set Suite Variable ${LE_ENCRYPT} ${ocfg['lets_encrypt']} + Should Not Be Empty ${HOST} + Should Be True ${HTTP2HTTPS} + Should Be True ${LE_ENCRYPT} + Check if wordpress works as expected - ${rc} = Execute Command curl -f http://127.0.0.1/wordpress/ - ... return_rc=True return_stdout=False - Should Be Equal As Integers ${rc} 0 + Wait Until Keyword Succeeds 20 times 3 seconds Ping wordpress Check if wordpress is removed correctly ${rc} = Execute Command remove-module --no-preserve ${module_id} ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 + +*** Keywords *** +Ping wordpress + ${out} ${err} ${rc} = Execute Command curl -k -f -H 'Host: wordpress.domain.org' https://127.0.0.1/wp-admin/install.php + ... return_rc=True return_stdout=True return_stderr=True + Should Be Equal As Integers ${rc} 0 + Should Contain ${out} WordPress \ No newline at end of file