Skip to content

Commit 0c90d8d

Browse files
committed
mirror project structure in tests/
1 parent b597a93 commit 0c90d8d

File tree

105 files changed

+66
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+66
-52
lines changed

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
uses: ./.github/workflows/install-slips-dependencies.yml
1313

1414

15-
integration-tests:
15+
e2e-tests:
1616
runs-on: ubuntu-22.04
1717
timeout-minutes: 1800
1818
# make this job depend on the first job
@@ -83,14 +83,14 @@ jobs:
8383
run: (command -v zeek && zeek --version) || (command -v bro && bro --version)
8484

8585

86-
- name: Run Integration Tests for ${{ matrix.test_file }}
86+
- name: Run e2e Tests for ${{ matrix.test_file }}
8787
run: |
88-
python3 -m pytest tests/integration_tests/${{ matrix.test_file }} -p no:warnings -vv -s -n 3
88+
python3 -m pytest tests/e2e/${{ matrix.test_file }} -p no:warnings -vv -s -n 3
8989
9090
- name: Upload Artifacts
9191
if: always()
9292
uses: actions/upload-artifact@v4
9393
with:
94-
name: ${{ matrix.test_file }}-integration-tests-output
94+
name: ${{ matrix.test_file }}-e2e-tests-output
9595
path: |
9696
output/integration_tests

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
test_file:
29-
- test_inputProc.py
29+
- test_input.py
3030
- test_main.py
3131
- test_conn.py
3232
- test_downloaded_file.py

modules/fidesModule/fidesModule.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import json
3-
from dataclasses import asdict
43
from pathlib import Path
54

65
from slips_files.common.slips_utils import utils
@@ -12,11 +11,10 @@
1211
dict_to_alert,
1312
Alert,
1413
)
15-
from .messaging.model import NetworkMessage
1614
from ..fidesModule.messaging.message_handler import MessageHandler
1715
from ..fidesModule.messaging.network_bridge import NetworkBridge
1816
from ..fidesModule.model.configuration import load_configuration
19-
from ..fidesModule.model.threat_intelligence import SlipsThreatIntelligence, ThreatIntelligence
17+
from ..fidesModule.model.threat_intelligence import SlipsThreatIntelligence
2018
from ..fidesModule.protocols.alert import AlertProtocol
2119
from ..fidesModule.protocols.initial_trusl import InitialTrustProtocol
2220
from ..fidesModule.protocols.opinion import OpinionAggregator
@@ -26,15 +24,13 @@
2624
ThreatIntelligenceProtocol,
2725
)
2826
from ..fidesModule.utils.logger import LoggerPrintCallbacks
29-
from ..fidesModule.messaging.redis_simplex_queue import RedisSimplexQueue, RedisDuplexQueue
27+
from ..fidesModule.messaging.redis_simplex_queue import RedisSimplexQueue
3028
from ..fidesModule.persistence.threat_intelligence_db import (
3129
SlipsThreatIntelligenceDatabase,
3230
)
3331
from ..fidesModule.persistence.trust_db import SlipsTrustDatabase
3432
from ..fidesModule.persistence.sqlite_db import SQLiteDB
3533

36-
from ..fidesModule.model.alert import Alert as FidesAlert
37-
3834

3935
class FidesModule(IModule):
4036
"""
@@ -230,6 +226,6 @@ def main(self):
230226
self.__intelligence.request_data(ip)
231227

232228
# TODO: the code below exists for testing purposes for
233-
# tests/integration_tests/test_fides.py
229+
# tests/e2e/test_fides.py
234230
if msg := self.get_msg("fides2network"):
235231
pass

tests/common_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def is_evidence_present(log_file, expected_evidence):
112112

113113
def create_output_dir(dirname) -> PosixPath:
114114
"""
115-
creates this output dir inside output/integration_tests/
115+
creates this output dir inside output/e2e/
116116
returns a full path to the created output dir
117117
"""
118118

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,4 @@ def kill_redis_server(pid):
105105
except redis.exceptions.ConnectionError:
106106
continue
107107

108-
print(f"Closed {closed_servers} unused redis-servers")
109-
110-
zeek_tmp_dir = os.path.join(os.getcwd(), "zeek_dir_for_testing")
111-
try:
112-
os.rmdir(zeek_tmp_dir)
113-
except (FileNotFoundError, OSError):
114-
pass
108+
print(f"Closed {closed_servers} redis servers")
File renamed without changes.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,4 +429,3 @@ local_p2p:
429429
# create p2p.log with additional info about peer communications?
430430
create_p2p_logfile : False
431431
use_p2p : False
432-

tests/integration_tests/test_config_files.py renamed to tests/e2e/test_config_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_conf_file(pcap_path, expected_profiles, output_dir, redis_port):
4545
"""
4646
In this test we're using tests/test.conf
4747
"""
48-
config_file = "tests/integration_tests/test.yaml"
48+
config_file = "tests/e2e/test.yaml"
4949
modify_yaml_config(
5050
output_filename=config_file,
5151
output_dir=os.getcwd(),
@@ -147,7 +147,7 @@ def test_conf_file2(pcap_path, expected_profiles, output_dir, redis_port):
147147
"""
148148
In this test we're using tests/test2.conf
149149
"""
150-
config_file = "tests/integration_tests/test2.yaml"
150+
config_file = "tests/e2e/test2.yaml"
151151
modify_yaml_config(
152152
output_filename=config_file,
153153
output_dir=os.getcwd(),

0 commit comments

Comments
 (0)