-
Notifications
You must be signed in to change notification settings - Fork 180
109 lines (96 loc) · 3.65 KB
/
unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: unit-tests
on:
pull_request:
branches:
- 'master'
- 'develop'
jobs:
tests:
runs-on: ubuntu-22.04
timeout-minutes: 1800
strategy:
matrix:
test_file:
- tests/test_inputProc.py
- tests/test_main.py
- tests/test_conn.py
- tests/test_downloaded_file.py
- tests/test_ssl.py
- tests/test_tunnel.py
- tests/test_ssh.py
- tests/test_dns.py
- tests/test_notice.py
- tests/test_software.py
- tests/test_smtp.py
- tests/test_whitelist.py
- tests/test_arp.py
- tests/test_blocking.py
- tests/test_flow_handler.py
- tests/test_horizontal_portscans.py
- tests/test_http_analyzer.py
- tests/test_vertical_portscans.py
- tests/test_network_discovery.py
- tests/test_virustotal.py
- tests/test_update_file_manager.py
- tests/test_threat_intelligence.py
- tests/test_slips_utils.py
- tests/test_slips.py
- tests/test_profiler.py
- tests/test_leak_detector.py
- tests/test_ip_info.py
- tests/test_evidence.py
- tests/test_asn_info.py
- tests/test_urlhaus.py
- tests/test_markov_chain.py
- tests/test_daemon.py
- tests/test_go_director.py
- tests/test_notify.py
- tests/test_checker.py
- tests/test_base_model.py
- tests/test_set_evidence.py
- tests/test_trustdb.py
- tests/test_cesnet.py
- tests/test_output.py
- tests/test_riskiq.py
- tests/test_spamhaus.py
- tests/test_evidence_handler.py
- tests/test_alert_handler.py
- tests/test_redis_manager.py
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: ''
- name: Enable memory overcommit (for redis)
run: sysctl vm.overcommit_memory=1
- 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_22.04/ /' | sudo tee /etc/apt/sources.list.d/security:zeek.list
curl -fsSL https://download.opensuse.org/repositories/security:zeek/xUbuntu_22.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 --fix-missing zeek
sudo ln -s /opt/zeek/bin/zeek /usr/local/bin/bro
- name: Set up Python 3.10.12
uses: actions/setup-python@v5
with:
python-version: "3.10.12"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install --no-cache-dir -r install/requirements.txt
- name: Start redis server
run: redis-server --daemonize yes
- name: Run Database Unit Tests
run: |
python3 -m pytest tests/test_database.py -p no:warnings -vv
- name: Run Unit Tests for ${{ matrix.test_file }}
run: |
python3 -m pytest ${{ matrix.test_file }} -p no:warnings -vv -s -n 5
- name: Upload Artifacts
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test_slips_locally-integration-tests-output
path: |
output/integration_tests