Skip to content

ci-prod: Use python directly #17

ci-prod: Use python directly

ci-prod: Use python directly #17

name: CI-production-integration-tests
on:
pull_request:
branches:
- 'master'
- '!develop'
# temporarily!!!!!!!!!!!!!!!!!!!!!
push:
branches:
- "alya/fix-config-file-tests"
jobs:
tests:
runs-on: ubuntu-22.04
timeout-minutes: 7200
strategy:
matrix:
test_file:
- tests/integration_tests/test_config_files.py
# - tests/integration_tests/test_portscans.py
# - tests/integration_tests/test_dataset.py
steps:
- uses: actions/checkout@v4
with:
ref: 'develop'
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_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
python3 -m pip install pytest-timeout
- name: Start redis server
run: redis-server --daemonize yes
- name: Test Test
run: python -c 'import os;os.system("ls")'
- name: Test 2
run: python3 slips.py -t -e 1 -f dataset/test7-malicious.pcap -o output/integration_tests/test_configuration_file -c tests/integration_tests/test.yaml -P 6667
- name: Run Integration Tests for ${{ matrix.test_file }}
run: |
timeout --signal=INT 1200 python3 -m pytest --full-trace ${{ matrix.test_file }} -vvv -s
- name: Clear redis cache
run: ./slips.py -cc
- name: Upload Artifacts
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test_slips_locally-integration-tests-output
path: |
output/integration_tests