generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
126 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Test module | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
debug_shell: | ||
description: "Debug shell" | ||
required: true | ||
type: boolean | ||
workflow_run: | ||
workflows: ["Publish images"] | ||
types: [completed] | ||
|
||
jobs: | ||
module: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == '' }} | ||
uses: NethServer/ns8-github-actions/.github/workflows/module-info.yml@main | ||
run_tests: | ||
needs: module | ||
uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@main | ||
with: | ||
args: "ghcr.io/${{needs.module.outputs.owner}}/${{needs.module.outputs.name}}:${{needs.module.outputs.tag}}" | ||
repo_ref: ${{needs.module.outputs.sha}} | ||
debug_shell: ${{ github.event.inputs.debug_shell == 'true' || false }} | ||
secrets: | ||
do_token: ${{ secrets.do_token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/tests/outputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 nethvoice-proxy is installed correctly | ||
Run task cluster/alter-repository {"name": "default", "status": true, "testing": true} | ||
... rc_expected=0 | ||
${output} ${rc} = Execute Command add-module nethvoice-proxy | ||
... return_rc=True | ||
Should Be Equal As Integers ${rc} 0 | ||
&{output} = Evaluate ${output} | ||
Set Global Variable ${proxy_module_id} ${output.module_id} | ||
Run task cluster/alter-repository {"name": "default", "status": true, "testing": true} | ||
... rc_expected=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*** Settings *** | ||
Library SSHLibrary | ||
|
||
*** Test Cases *** | ||
Check if nethvoice is installed correctly | ||
${output} ${rc} = Execute Command add-module ${IMAGE_URL} 1 | ||
... return_rc=True | ||
Should Be Equal As Integers ${rc} 0 | ||
&{output} = Evaluate ${output} | ||
Set Global Variable ${module_id} ${output.module_id} |
8 changes: 8 additions & 0 deletions
8
tests/10_nethvoice_actions/00_configure_module_validation.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*** Settings *** | ||
Library SSHLibrary | ||
Resource ../api.resource | ||
|
||
*** Test Cases *** | ||
Input can't be empty | ||
${response} = Run task module/${module_id}/configure-module | ||
... {} rc_expected=10 decode_json=False |
8 changes: 8 additions & 0 deletions
8
tests/10_nethvoice_actions/00_set-nethvoice-admin-password_validation.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*** Settings *** | ||
Library SSHLibrary | ||
Resource ../api.resource | ||
|
||
*** Test Cases *** | ||
Input can't be empty | ||
${response} = Run task module/${module_id}/set-nethvoice-admin-password | ||
... {} rc_expected=10 decode_json=False |
21 changes: 21 additions & 0 deletions
21
tests/10_nethvoice_actions/10_configure_integrations.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
*** Settings *** | ||
Library SSHLibrary | ||
Resource ../api.resource | ||
|
||
*** Test Cases *** | ||
Check if nethvoice can be configured correctly | ||
${response} = Run task module/${module_id}/configure-module | ||
... {"nethvoice_host": "voice.ns8.local", "nethcti_ui_host": "cti.ns8.local", "user_domain": "${users_domain}", "reports_international_prefix": "+39", "lets_encrypt": false} | ||
... decode_json=False | ||
|
||
Check if nethvoice is configured as expected | ||
${response} = Run task module/${module_id}/get-configuration {} | ||
Should Be Equal As Strings ${response['nethvoice_host']} voice.ns8.local | ||
Should Be Equal As Strings ${response['nethcti_ui_host']} cti.ns8.local | ||
Should Be Equal As Strings ${response['user_domain']} ${users_domain} | ||
Should Be Equal As Strings ${response['reports_international_prefix']} +39 | ||
Should Be Equal As Strings ${response['lets_encrypt']} False | ||
|
||
Check if the password can be changed | ||
${response} = Run task module/${module_id}/set-nethvoice-admin-password | ||
... {"nethvoice_admin_password": "Nethesis,1234"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*** Settings *** | ||
Library SSHLibrary | ||
Resource ./api.resource | ||
|
||
*** Test Cases *** | ||
Check if nethvoice-proxy is removed correctly | ||
${rc} = Execute Command remove-module --no-preserve ${proxy_module_id} | ||
... return_rc=True return_stdout=False | ||
Should Be Equal As Integers ${rc} 0 | ||
|
||
Check if nethvoice 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 | ||
|
||
Remove internal domain | ||
Run task cluster/remove-internal-domain {"domain":"${users_domain}"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file was deleted.
Oops, something went wrong.