Skip to content

added more test for Threat_intelligence module #731

added more test for Threat_intelligence module

added more test for Threat_intelligence module #731

Workflow file for this run

# This workflow will install Slips dependencies and run unit tests
name: CI-staging
on:
push:
branches:
# features will be added to this branch using PRs, not need to re-run the tests on push
- '!develop'
- '!master'
pull_request:
branches:
- 'develop'
- '!master'
jobs:
unit_tests:
# specify the host OS
runs-on: ubuntu-latest
# 2 hours timeout
timeout-minutes: 7200
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
steps:
- uses: actions/checkout@v2
- name: Start redis server
run: redis-server --daemonize yes
- name: Run database unit tests
run: |
coverage run --source=./ -m pytest tests/test_database.py -p no:warnings -vv
coverage report --include="slips_files/core/database/*"
coverage html --include="slips_files/core/database/*" -d coverage_reports/database
- name: Clear redis cache
run: ./slips.py -cc
- name: Flowalerts Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_flowalerts.py -p no:warnings -vv
coverage report --include="modules/flowalerts/*"
coverage html --include="modules/flowalerts/*" -d coverage_reports/flowalerts
- name: Whitelist Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_whitelist.py -p no:warnings -vv
coverage report --include="slips_files/core/helpers/whitelist.py*"
coverage html --include="slips_files/core/helpers/whitelist.py*" -d coverage_reports/whitelist
- name: ARP Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_arp.py -p no:warnings -vv
coverage report --include="modules/arp/*"
coverage html --include="modules/arp/*" -d coverage_reports/arp
- name: Blocking Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_blocking.py -p no:warnings -vv
coverage report --include="modules/blocking/*"
coverage html --include="modules/blocking/*" -d coverage_reports/blocking
- name: Flowhandler Unit Test
run: |
coverage run --source=./ -m pytest tests/test_flow_handler.py -p no:warnings -vv
coverage report --include="slips_files/core/helpers/flow_handler.py*"
coverage html --include="slips_files/core/helpers/flow_handler.py*" -d coverage_reports/flowhandler
- name: Horizontal Portscans Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_horizontal_portscans.py -p no:warnings -vv
coverage report --include="modules/network_discovery/horizontal_portscan.py*"
coverage html --include="modules/network_discovery/horizontal_portscan.py*" -d coverage_reports/horizontal_portscan
- name: HTTP Analyzer Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_http_analyzer.py -p no:warnings -vv
coverage report --include="modules/http_analyzer/http_analyzer.py*"
coverage html --include="modules/http_analyzer/http_analyzer.py*" -d coverage_reports/http_analyzer
- name: Vertical Portscans Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_vertical_portscans.py -p no:warnings -vv
coverage report --include="modules/network_discovery/vertical_portscan.py*"
coverage html --include="modules/network_discovery/vertical_portscan.py*" -d coverage_reports/vertical_portscan
- name: Virustotal Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_virustotal.py -p no:warnings -vv
coverage report --include="modules/virustotal/virustotal.py*"
coverage html --include="modules/virustotal/virustotal.py*" -d coverage_reports/virustotal
- name: Update Manager Unit tests
run: |
coverage run --source=./ -m pytest tests/test_update_file_manager.py -p no:warnings -vv
coverage report --include="modules/update_manager/update_manager.py*"
coverage html --include="modules/update_manager/update_manager.py*" -d coverage_reports/updatemanager
- name: Threat Intelligence Unit tests
run: |
coverage run --source=./ -m pytest tests/test_threat_intelligence.py -p no:warnings -vv
coverage report --include="modules/threat_intelligence/threat_intelligence.py*"
coverage html --include="modules/threat_intelligence/threat_intelligence.py*" -d coverage_reports/threat_intelligence
- name: Slips Utils Unit tests
run: |
coverage run --source=./ -m pytest tests/test_slips_utils.py -p no:warnings -vv
coverage report --include="slips_files/common/slips_utils.py*"
coverage html --include="slips_files/common/slips_utils.py*" -d coverage_reports/slips_utils
- name: Slips.py Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_slips.py -p no:warnings -vv
coverage report --include="slips.py*"
coverage html --include="slips.py*" -d coverage_reports/slips
- name: Profiler Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_profiler.py -p no:warnings -vv
coverage report --include="slips_files/core/profiler.py*"
coverage html --include="slips_files/core/profiler.py*" -d coverage_reports/profiler
- name: Leak Detector Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_leak_detector.py -p no:warnings -vv
coverage report --include="modules/leak_detector/leak_detector.py*"
coverage html --include="modules/leak_detector/leak_detector.py*" -d coverage_reports/leak_detector
- name: Ipinfo Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_ip_info.py -p no:warnings -vv
coverage report --include="modules/ip_info/ip_info.py*"
coverage html --include="modules/ip_info/ip_info.py*" -d coverage_reports/ip_info
- name: Input Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_inputProc.py -p no:warnings -vv
coverage report --include="slips_files/core/input.py*"
coverage html --include="slips_files/core/input.py*" -d coverage_reports/input
dataset_integration_tests:
# specify the host OS
runs-on: ubuntu-latest
# 1h timeout
timeout-minutes: 3600
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
steps:
- uses: actions/checkout@v2
- name: Start redis server
run: redis-server --daemonize yes
- name: Dataset Integration Tests
run: |
python3 -m pytest -s tests/integration_tests/test_dataset.py -p no:warnings -vv
zeek_integration_tests:
# specify the host OS
runs-on: ubuntu-latest
# 1h timeout
timeout-minutes: 3600
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
steps:
- uses: actions/checkout@v2
- name: Start redis server
run: redis-server --daemonize yes
- name: Dataset Integration Tests
run: |
python3 -m pytest -s tests/integration_tests/test_pcap_dataset.py -p no:warnings -vv
pcap_integration_tests:
# specify the host OS
runs-on: ubuntu-latest
# 1h timeout
timeout-minutes: 3600
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
steps:
- uses: actions/checkout@v2
- name: Start redis server
run: redis-server --daemonize yes
- name: Dataset Integration Tests
run: |
python3 -m pytest -s tests/integration_tests/test_zeek_dataset.py -p no:warnings -vv
port_scans_integration_tests:
# specify the host OS
runs-on: ubuntu-latest
# 1h timeout
timeout-minutes: 3600
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
steps:
- uses: actions/checkout@v2
- name: Start redis server
run: redis-server --daemonize yes
- name: Dataset Integration Tests
# python3 -m pytest -s tests/integration_tests/test_portscans.py -p no:warnings -vv
run: |
coverage run --source=./ -m pytest -s tests/integration_tests/test_portscans.py -p no:warnings -vv
coverage report --include="modules/network_discovery/*"
coverage html --include="modules/network_discovery/*" -d coverage_reports/network_discovery
config_files_integration_tests:
# specify the host OS
runs-on: ubuntu-latest
# 1h timeout
timeout-minutes: 3600
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
steps:
- uses: actions/checkout@v2
- name: Start redis server
run: redis-server --daemonize yes
- name: Config File Integration Tests
run: |
python3 -m pytest -s tests/integration_tests/test_config_files.py -p no:warnings -vv
- name: Upload Artifact
# run this job whether the above jobs failed or passed
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test_slips_locally-integration-tests-output
path: |
output/integration_tests
coverage_reports/