test(sandbox): comprehensive test suite for exploit_sandbox module (+76 tests) - #144
Open
manus-use wants to merge 1 commit into
Open
test(sandbox): comprehensive test suite for exploit_sandbox module (+76 tests)#144manus-use wants to merge 1 commit into
manus-use wants to merge 1 commit into
Conversation
This was referenced Jul 24, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive test suite for the
manus_agent.sandbox.exploit_sandboxmodule — 76 fully-mocked tests covering the entireExploitSandboxclass and all module-level helper functions.What's tested
ExploitSandbox class
__init__— default params, custom params, unique UIDs across instances_labels— role tagging structure for all resource typesbuild_target— image build via docker_retry, build log collection (stream filtering), error propagationstart_target— network creation, container creation, network connect with alias, container start, wait_for_container_running, environment passingwait_for_target— success on first probe, timeout (deadline exceeded), transient Docker error retry loop, non-transient error propagationrun_exploit— container creation on isolated network, code copy, interpreter resolution, exec execution, environment merging (TARGET_HOST + custom), None output handling, fallback interpreter reporting, non-zero exit codesrun_local_exploit— target-not-running guard, execution inside target container, env passing, None env defaultget_target_logs— success, exception swallowing, no container, non-UTF-8 bytesget_target_exit_code— success, non-zero exit, reload exception, missing State key, no containerget_docker_ps_all— success with tags, without tags (short_id fallback), list exception, per-container reload exception, no clientcleanup— full teardown (all resources), partial state, client close error handling, no clientHelper functions
_copy_to_container— tar archive creation, put_archive call, binary data, nested paths_file_extension— python/bash/sh/unknown/case-insensitive_execution_command— all languages + unknown default + case-insensitive_interpreter_candidates— python (python3 first), bash, sh, unknown, case-insensitive, empty string_resolve_interpreter— first candidate found, fallback candidate, empty candidates error, exec failure error, exit code 127, unexpected stdout, single candidateIntegration lifecycle tests
Test characteristics
ruff check .passes with no warningsOverlap check
Confirmed no duplicate by reviewing all open PRs:
utils/docker_client.py(different module — Docker utility functions)sandbox/docker_sandbox.py(different module — general code execution sandbox)tools/code_execute.py(higher-level tool, mocks ExploitSandbox)tools/submit_cves.pyandverify_exploit.py(tool-level, uses FakeSandbox)No existing open or merged PR provides dedicated tests for
sandbox/exploit_sandbox.py.