Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for containers #363

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

spiderxm
Copy link
Collaborator

Description

Added test cases to test graceful shutting of modules.

  • Killing the module (using docker kill module_container_name)
  • Shutting the module (Sending Ctrl + C event to the command line)

Screenshots (if appropriate):

Screenshot 2022-08-26 at 5 23 40 PM

@spiderxm spiderxm changed the base branch from master to development August 26, 2022 11:58
core/load.py Outdated
@@ -887,7 +887,7 @@ def load_honeypot_engine():
if run_as_test:
network_traffic_capture_process.terminate()
# without ci it will be terminate after a few seconds, it needs to kill the tshark and update pcap file collection
network_traffic_capture_process.join()
# network_traffic_capture_process.join()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this doing?

tests/pytest.ini Show resolved Hide resolved
tests/test_module_shutting.py Outdated Show resolved Hide resolved
tests/test_module_killing.py Outdated Show resolved Hide resolved
@spiderxm
Copy link
Collaborator Author

@dhirensr first merge #361 before this PR

break
sys.stdout.buffer.write(c)
output += c.decode("utf-8")
if messages["network_traffic_capture_start"] in output and is_network_traffic_capture_started is False:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for variables lets use = operator

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for output we cant use == as output is being appended after getting data from the output stream

tests/test_module_shutting.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants