Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SSHLibrary to api.resource test file #31

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
3 changes: 2 additions & 1 deletion tests/dokuwiki.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Library SSHLibrary
Resource api.resource

*** Test Cases ***
Check if dokuwiki is installed correctly
Expand All @@ -10,7 +11,7 @@ Check if dokuwiki is installed correctly
Set Suite Variable ${module_id} ${output.module_id}

Check if dokuwiki can be configured
${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"wiki_name": "mywiki","username":"admin","password":"admin","email":"[email protected]","user_full_name":"Admin","host":"dokuwiki.test.local","http2https": true,"lets_encrypt": false}'
${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"wiki_name": "mywiki","username":"admin","password":"admin","email":"[email protected]","user_full_name":"Admin","host":"dokuwiki.test.local","http2https": true,"lets_encrypt": false, "ldap_domain": "domain.com"}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Expand Down
Loading