Skip to content

Slips v1.0.15

Slips v1.0.15 #93

name: CI-production
on:
pull_request:
branches:
- 'master'
- '!develop'
jobs:
unit_and_integration_tests:
# runs the tests on a GH VM
runs-on: ubuntu-20.04
# 2 hours timeout
timeout-minutes: 7200
steps:
- uses: actions/checkout@v3
with:
ref: 'develop'
# Fetch all history for all tags and branches
fetch-depth: ''
- name: Install slips dependencies
run: sudo apt-get update --fix-missing && sudo apt-get -y --no-install-recommends install python3 redis-server python3-pip python3-certifi python3-dev build-essential file lsof net-tools iproute2 iptables python3-tzlocal nfdump tshark git whois golang nodejs notify-osd yara libnotify-bin
- name: Install Zeek
run: |
sudo echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/security:zeek.list
curl -fsSL https://download.opensuse.org/repositories/security:zeek/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/security_zeek.gpg > /dev/null
sudo apt update
sudo apt install -y --no-install-recommends zeek
sudo ln -s /opt/zeek/bin/zeek /usr/local/bin/bro
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
grep -v 'black' install/requirements.txt | xargs pip3 install --no-cache-dir
pip install coverage
- name: Start redis server
run: redis-server --daemonize yes
- name: Run unit tests
run: python3 -m pytest tests/ --ignore="tests/test_database.py" --ignore="tests/integration_tests" -n 7 -p no:warnings -vv -s
- name: Run database unit tests
run: |
python3 -m pytest tests/test_database.py -p no:warnings -vv
- name: Flowalerts Unit Tests
run: |
python3 -m pytest tests/test_flowalerts.py -p no:warnings -vv
- name: Whitelist Unit Tests
run: |
python3 -m pytest tests/test_whitelist.py -p no:warnings -vv
- name: ARP Unit Tests
run: |
python3 -m pytest tests/test_arp.py -p no:warnings -vv
- name: Blocking Unit Tests
run: |
python3 -m pytest tests/test_blocking.py -p no:warnings -vv
- name: Flowhandler Unit Test
run: |
python3 -m pytest tests/test_flow_handler.py -p no:warnings -vv
- name: Horizontal Portscans Unit Tests
run: |
python3 -m pytest tests/test_horizontal_portscans.py -p no:warnings -vv
- name: HTTP Analyzer Unit Tests
run: |
python3 -m pytest tests/test_http_analyzer.py -p no:warnings -vv
- name: Vertical Portscans Unit Tests
run: |
python3 -m pytest tests/test_vertical_portscans.py -p no:warnings -vv
- name: Virustotal Unit Tests
run: |
python3 -m pytest tests/test_virustotal.py -p no:warnings -vv
- name: Update Manager Unit tests
run: |
python3 -m pytest tests/test_update_file_manager.py -p no:warnings -vv
- name: Threat Intelligence Unit tests
run: |
python3 -m pytest tests/test_threat_intelligence.py -p no:warnings -vv
- name: Slips Utils Unit tests
run: |
python3 -m pytest tests/test_slips_utils.py -p no:warnings -vv
- name: Slips.py Unit Tests
run: |
python3 -m pytest tests/test_slips.py -p no:warnings -vv
- name: Profiler Unit Tests
run: |
python3 -m pytest tests/test_profiler.py -p no:warnings -vv
- name: Leak Detector Unit Tests
run: |
python3 -m pytest tests/test_leak_detector.py -p no:warnings -vv
- name: Ipinfo Unit Tests
run: |
python3 -m pytest tests/test_ip_info.py -p no:warnings -vv
- name: Input Unit Tests
run: |
python3 -m pytest tests/test_inputProc.py -p no:warnings -vv
- name: Clear redis cache
run: ./slips.py -cc
- name: Portscan tests
run: |
python3 -m pytest -s tests/integration_tests/test_portscans.py -p no:warnings -vv
- name: Integration tests
run: |
python3 -m pytest -s tests/integration_tests/test_dataset.py -p no:warnings -vv
- name: Config file 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