Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Amygos committed Jan 8, 2025
1 parent 99ee0a5 commit d28d7c0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/00_webtop_install_dependences.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*** Settings ***
Library SSHLibrary
Resource ./api.resource

*** Test Cases ***
Setup internal user provider
${response} = Run task cluster/add-internal-provider {"image":"openldap","node":1}
Set Global Variable ${openldap_module_id} ${response['module_id']}
Set Global Variable ${users_domain} domain.ns8.local
Run task module/${openldap_module_id}/configure-module {"domain":"${users_domain}","admuser":"admin","admpass":"Nethesis,1234","provision":"new-domain"}

Check if mail is installed correctly
${output} ${rc} = Execute Command add-module mail
... return_rc=True
Should Be Equal As Integers ${rc} 0
&{output} = Evaluate ${output}
Set Global Variable ${mail_module_id} ${output.module_id}
Set Global Variable ${mail_domain} ns8.local
Set Global Variable ${mail_hostname} mail.ns8.local
Run task module/${mail_module_id}/configure-module {"hostname":"${mail_hostname}","user_domain":"${users_domain}","mail_domain":"${mail_domain}"}
... decode_json=False rc_expected=0
14 changes: 14 additions & 0 deletions tests/api.resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*** Settings ***
Library SSHLibrary

*** Keywords ***
Run task
[Arguments] ${action} ${input} ${decode_json}=${TRUE} ${rc_expected}=0
${stdout} ${stderr} ${rc} = Execute Command api-cli run ${action} --data '${input}' return_stdout=True return_stderr=True return_rc=True
Should Be Equal As Integers ${rc_expected} ${rc} Run task ${action} failed!${\n}${stderr}
IF ${decode_json} and len($stdout) > 0
${response} = Evaluate json.loads('''${stdout}''') modules=json
ELSE
${response} = Set Variable ${stdout}
END
[Return] ${response}

0 comments on commit d28d7c0

Please sign in to comment.