Skip to content

Commit

Permalink
Merge pull request #30 from NethServer/test
Browse files Browse the repository at this point in the history
Crowdsec basic test with robot
  • Loading branch information
stephdl authored Mar 21, 2024
2 parents 4e5f714 + fad9f98 commit a2dfdab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clean-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
steps:
- uses: NethServer/ns8-github-actions/.github/actions/delete-image@v1
with:
images: "kickstart"
images: "crowdsec"
delete_image_token: ${{ secrets.IMAGES_CLEANUP_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/test-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
uses: NethServer/ns8-github-actions/.github/workflows/module-info.yml@main
run_tests:
needs: module
uses: NethServer/ns8-github-actions/.github/workflows/test-on-ubuntu-runner.yml@main
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 }}
7 changes: 1 addition & 6 deletions tests/crowdsec.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ Check if crowdsec is installed correctly
Set Suite Variable ${module_id} ${output.module_id}

Check if crowdsec can be configured
${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"receiver_emails":["foo@domain.com"],"helo_host":"myfqdn.domain.com"}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Check if crowdsec works as expected
${rc} = Execute Command exec 3<>/dev/tcp/127.0.0.1/${TCP_PORT}
${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"ban_local_network": true,"bantime": "1","dyn_bantime": true,"enable_online_api": true,"enroll_instance": "","helo_host": "","receiver_emails": [""],"whitelists": [""]}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Expand Down

0 comments on commit a2dfdab

Please sign in to comment.