fix issues with output redirection #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 'alya/fix-config-file-tests' | |
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 1 | |
run: ./slips.py -h | |
- name: Test 2 | |
env: | |
PYTHONUNBUFFERED: 1 # Ensures real-time logging | |
# run: python3 -u 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 | |
run: ./slips.py -e 1 -f dataset/test9-mixed-zeek-dir -o alia | |
- 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 |