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

Monitor a background process #6

Closed
wants to merge 3 commits into from
Closed

Monitor a background process #6

wants to merge 3 commits into from

Conversation

rkoumis
Copy link
Owner

@rkoumis rkoumis commented Mar 7, 2024

  • Monitor async python process spawned in background
    • Be able to detect if background process completed ok or errored
  • Accurately report failure status on execution failures
    • The agent used to report RUNNING when the process actually FAILED
  • Add base64 encoding capability to send_file
  • Detect and log errors that occur during send_file
  • Add DELETE capability to the HTTPRequestHandler
    • This gives us the option of adding DELETE methods in future
  • Allow json_success to have status codes
  • Allow json_error to accept kwargs, like json_success already does
  • More detailed error messages for certain kinds of failure
    • creating directory; storing file; extracting zip file

rkoumis added 3 commits March 6, 2024 18:41
- Added file test_agent.py
- Tests can be run in Windows or Linux
- Tests will be run in github actions
- Test most existing functionality of the agent
- In send_file open the file in binary mode (bug fix)
- Updates to the agent to make it testable, including:
  - Pass a multiprocessing event to the run() method when under test,
    so the test knows when the agent process is ready
  - Tweaks to the shutdown method enabling testing
- Let jsonify not crash if values cannot be serialized
- Add a new command-line parameter, -v, useful when testing interactively
  - When -v is given, stdout and stderr will simply go to the console
- Allow the 'date' command to be executed from localhost; for testing

ran ruff.
- Use an enum for the status. Only accept expected values.
- No longer require x86 python for the agent.
  - It's only the analyzer that still requires x86 python.
- Check that we can read a file before trying to send it.
- Monitor async python process spawned in background
  - Be able to detect if background process completed ok or errored
- Accurately report failure status on execution failures
  - The agent used to report RUNNING when the process actually FAILED
- Add base64 encoding capability to send_file
- Detect and log errors that occur during send_file
- Add DELETE capability to the HTTPRequestHandler
  - This gives us the option of adding DELETE methods in future
- Allow json_success to have status codes
- Allow json_error to accept kwargs, like json_success already does
- More detailed error messages for certain kinds of failure
  - creating directory; storing file; extracting zip file
@rkoumis rkoumis closed this Mar 7, 2024
@rkoumis rkoumis deleted the tests-for-agent-p3 branch November 18, 2024 23:11
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.

1 participant