← Về thư mục
tests/test_kernel_sandbox.py
- _reset_warn_once_dedup · function · L35-L45 — def _reset_warn_once_dedup(monkeypatch)
- _passing_runner · function · L48-L73 — def _passing_runner(calls: list | None = None, *, sibling_isolated: bool = False)
- run · function · L49-L71 — def run(command, **kwargs)
- _failing_runner · function · L76-L82 — def _failing_runner(command, **kwargs)
- test_seatbelt_profile_escapes_paths_and_blocks_network_by_default · function · L85-L98 — def test_seatbelt_profile_escapes_paths_and_blocks_network_by_default()
- test_seatbelt_raw_network_switch_is_explicit_and_argv_has_no_shell · function · L101-L113 — def test_seatbelt_raw_network_switch_is_explicit_and_argv_has_no_shell()
- test_seatbelt_denies_sibling_reads_and_reallows_only_exact_workspace · function · L116-L136 — def test_seatbelt_denies_sibling_reads_and_reallows_only_exact_workspace(tmp_path)
- test_seatbelt_rejects_a_workspace_outside_or_equal_to_isolation_root · function · L139-L156 — def test_seatbelt_rejects_a_workspace_outside_or_equal_to_isolation_root(tmp_path)
- test_seatbelt_multi_tenant_policy_denies_data_and_personal_roots_exactly · function · L159-L191 — def test_seatbelt_multi_tenant_policy_denies_data_and_personal_roots_exactly( tmp_path, )
- test_bwrap_mounts_only_workspace_and_private_temp_writable · function · L194-L217 — def test_bwrap_mounts_only_workspace_and_private_temp_writable()
- test_runtime_bwrap_inherits_the_pipe_transport_session · function · L220-L254 — def test_runtime_bwrap_inherits_the_pipe_transport_session(tmp_path)
- test_the_self_test_probes_the_argv_the_runtime_actually_launches · function · L257-L285 — def test_the_self_test_probes_the_argv_the_runtime_actually_launches(tmp_path)
- test_bwrap_raw_network_compatibility_switch_only_removes_network_namespace · function · L288-L300 — def test_bwrap_raw_network_compatibility_switch_only_removes_network_namespace()
- test_bwrap_hides_shared_root_and_rebinds_only_workspace · function · L303-L332 — def test_bwrap_hides_shared_root_and_rebinds_only_workspace(tmp_path)
- test_bwrap_masks_every_private_root_and_ro_binds_only_exact_exceptions · function · L335-L371 — def test_bwrap_masks_every_private_root_and_ro_binds_only_exact_exceptions(tmp_path)
- _team_interrupt_sandbox · function · L374-L395 — def _team_interrupt_sandbox(tmp_path)
- _write_proc_status · function · L398-L404 — def _write_proc_status(proc_root, pid, parent)
- _write_proc_children · function · L407-L413 — def _write_proc_children(proc_root, pid, children)
- _seed_team_bwrap_proc · function · L416-L420 — def _seed_team_bwrap_proc(proc_root, *, launcher=4100, init=4101, command=4102)
- test_team_bwrap_uses_info_fd_and_persistent_pidfd_for_interrupts · function · L423-L476 — def test_team_bwrap_uses_info_fd_and_persistent_pidfd_for_interrupts( monkeypatch, tmp_path )
- open_pidfd · function · L434-L436 — def open_pidfd(pid, flags)
- test_team_bwrap_rejects_invalid_bounded_info_report · function · L486-L494 — def test_team_bwrap_rejects_invalid_bounded_info_report(tmp_path, report, failure)
- test_team_bwrap_info_timeout_and_missing_pidfd_fail_closed · function · L497-L514 — def test_team_bwrap_info_timeout_and_missing_pidfd_fail_closed(monkeypatch, tmp_path)
- test_team_bwrap_rejects_zero_or_multiple_init_children · function · L524-L554 — def test_team_bwrap_rejects_zero_or_multiple_init_children( monkeypatch, tmp_path, children, failure )
- test_team_bwrap_revalidates_parent_chain_after_pinning_command · function · L564-L607 — def test_team_bwrap_revalidates_parent_chain_after_pinning_command( monkeypatch, tmp_path, changed_process, failure )
- open_pidfd · function · L573-L581 — def open_pidfd(pid, _flags)
- test_pipe_transport_passes_only_requested_info_fd · function · L610-L630 — def test_pipe_transport_passes_only_requested_info_fd(tmp_path)
- test_pipe_transport_reaps_and_closes_when_process_adoption_fails · function · L633-L682 — def test_pipe_transport_reaps_and_closes_when_process_adoption_fails( monkeypatch, tmp_path )
- Stream · class · L636-L640 — class Stream
- close · method · L639-L640 — def close(self)
- Process · class · L642-L657 — class Process
- init · method · L645-L650 — def init(self)
- kill · method · L652-L653 — def kill(self)
- wait · method · L655-L657 — def wait(self, *, timeout)
- reject_adoption · function · L666-L667 — def reject_adoption(_pid)
- _interrupt_sandbox · function · L685-L698 — def _interrupt_sandbox(tmp_path, *, backend="bubblewrap", enforced=True)
- test_bwrap_interrupt_resolves_and_validates_direct_worker · function · L701-L715 — def test_bwrap_interrupt_resolves_and_validates_direct_worker(tmp_path)
- test_bwrap_interrupt_falls_back_for_ambiguous_procfs · function · L728-L742 — def test_bwrap_interrupt_falls_back_for_ambiguous_procfs( tmp_path, children, worker_status )
- test_interrupt_target_uses_launcher_outside_enforced_bwrap · function · L748-L754 — def test_interrupt_target_uses_launcher_outside_enforced_bwrap( tmp_path, backend, enforced )
- test_bwrap_interrupt_pins_worker_with_pidfd_before_signalling · function · L757-L799 — def test_bwrap_interrupt_pins_worker_with_pidfd_before_signalling( tmp_path, monkeypatch )
- pidfd_open · function · L775-L777 — def pidfd_open(pid, flags)
- pidfd_send_signal · function · L779-L780 — def pidfd_send_signal(fd, signum, siginfo, flags)
- test_bwrap_interrupt_refuses_a_target_that_changes_after_pidfd_open · function · L802-L838 — def test_bwrap_interrupt_refuses_a_target_that_changes_after_pidfd_open( tmp_path, monkeypatch )
- test_bwrap_interrupt_never_falls_back_to_a_numeric_child_pid · function · L842-L875 — def test_bwrap_interrupt_never_falls_back_to_a_numeric_child_pid( tmp_path, monkeypatch, failure )
- exited · function · L863-L864 — def exited(_pid, _flags)
- test_bwrap_interrupt_reports_an_unreachable_worker_once · function · L878-L902 — def test_bwrap_interrupt_reports_an_unreachable_worker_once( tmp_path, monkeypatch, capsys )
- test_bwrap_interrupt_reports_missing_pidfd_support · function · L905-L911 — def test_bwrap_interrupt_reports_missing_pidfd_support(tmp_path, monkeypatch, capsys)
- test_kernel_interrupt_lets_the_sandbox_own_bwrap_signal_delivery · function · L914-L936 — def test_kernel_interrupt_lets_the_sandbox_own_bwrap_signal_delivery()
- Process · class · L917-L926 — class Process
- poll · method · L921-L922 — def poll()
- send_signal · method · L925-L926 — def send_signal(signum)
- _fake_worker · function · L939-L951 — def _fake_worker(calls, *, alive=True)
- Process · class · L940-L949 — class Process
- poll · method · L944-L945 — def poll()
- send_signal · method · L948-L949 — def send_signal(signum)
- test_kernel_interrupt_signals_the_direct_process_outside_bwrap · function · L954-L978 — def test_kernel_interrupt_signals_the_direct_process_outside_bwrap(monkeypatch)
- test_a_delivered_main_thread_signal_is_not_sent_a_second_time · function · L981-L1005 — def test_a_delivered_main_thread_signal_is_not_sent_a_second_time(monkeypatch)
- test_an_owned_but_undelivered_interrupt_is_reported_as_undelivered · function · L1008-L1040 — def test_an_owned_but_undelivered_interrupt_is_reported_as_undelivered()
- Process · class · L1016-L1025 — class Process
- poll · method · L1020-L1021 — def poll()
- send_signal · method · L1024-L1025 — def send_signal(signum): # pragma: no cover - must not be reached
- test_interrupting_an_exited_worker_does_not_report_a_delivered_stop · function · L1043-L1066 — def test_interrupting_an_exited_worker_does_not_report_a_delivered_stop()
- Process · class · L1048-L1057 — class Process
- poll · method · L1052-L1053 — def poll()
- send_signal · method · L1056-L1057 — def send_signal(signum): # pragma: no cover - must not be reached
- test_the_sandbox_records_every_interrupt_gap_but_prints_once · function · L1069-L1086 — def test_the_sandbox_records_every_interrupt_gap_but_prints_once(capsys)
- test_seatbelt_profile_appends_targeted_read_denies · function · L1089-L1108 — def test_seatbelt_profile_appends_targeted_read_denies()
- test_seatbelt_profile_rejects_unknown_deny_read_kind · function · L1111-L1113 — def test_seatbelt_profile_rejects_unknown_deny_read_kind()
- test_bwrap_masks_secret_reads_after_binds_and_skips_missing · function · L1116-L1146 — def test_bwrap_masks_secret_reads_after_binds_and_skips_missing(tmp_path)
- test_default_secret_read_denials_uses_data_dir_and_drops_workspace · function · L1149-L1161 — def test_default_secret_read_denials_uses_data_dir_and_drops_workspace( tmp_path, monkeypatch )
- test_off_is_explicit_and_skips_detection_and_self_test · function · L1164-L1180 — def test_off_is_explicit_and_skips_detection_and_self_test(tmp_path)
- unexpected · function · L1165-L1166 — def unexpected(args, *kwargs)
- test_auto_missing_backend_falls_back_with_visible_status_and_warning · function · L1183-L1198 — def test_auto_missing_backend_falls_back_with_visible_status_and_warning(tmp_path)
- test_enforce_fails_closed_when_backend_is_missing · function · L1201-L1208 — def test_enforce_fails_closed_when_backend_is_missing(tmp_path)
- test_workspace_read_isolation_never_degrades_without_a_boundary · function · L1212-L1224 — def test_workspace_read_isolation_never_degrades_without_a_boundary(tmp_path, mode)
- test_workspace_read_isolation_fails_closed_on_incomplete_self_test · function · L1227-L1252 — def test_workspace_read_isolation_fails_closed_on_incomplete_self_test(tmp_path)
- test_workspace_read_isolation_accepts_only_a_complete_probe · function · L1255-L1276 — def test_workspace_read_isolation_accepts_only_a_complete_probe(tmp_path)
- test_team_boundary_refuses_a_preexisting_external_hardlink · function · L1279-L1296 — def test_team_boundary_refuses_a_preexisting_external_hardlink(tmp_path)
- test_team_boundary_allows_hardlinks_fully_accounted_for_in_workspace · function · L1299-L1315 — def test_team_boundary_allows_hardlinks_fully_accounted_for_in_workspace(tmp_path)
- test_workspace_hardlink_scan_streams_a_wide_directory · function · L1318-L1349 — def test_workspace_hardlink_scan_streams_a_wide_directory(monkeypatch, tmp_path)
- Entry · class · L1323-L1328 — class Entry
- stat · method · L1326-L1328 — def stat(self, *, follow_symlinks)
- Scan · class · L1330-L1342 — class Scan
- iter · method · L1331-L1332 — def iter(self)
- next · method · L1334-L1339 — def next(self)
- close · method · L1341-L1342 — def close(self)
- test_allowed_root_probe_streams_its_entry_budget · function · L1352-L1385 — def test_allowed_root_probe_streams_its_entry_budget(monkeypatch, tmp_path)
- Entry · class · L1357-L1362 — class Entry
- stat · method · L1360-L1362 — def stat(self, *, follow_symlinks)
- Scan · class · L1364-L1376 — class Scan
- iter · method · L1365-L1366 — def iter(self)
- next · method · L1368-L1373 — def next(self)
- close · method · L1375-L1376 — def close(self)
- test_team_private_temp_lives_under_protected_data_and_masks_system_temp · function · L1388-L1415 — def test_team_private_temp_lives_under_protected_data_and_masks_system_temp(tmp_path)
- test_system_temp_mask_preserves_an_exact_runtime_exception · function · L1418-L1447 — def test_system_temp_mask_preserves_an_exact_runtime_exception(monkeypatch, tmp_path)
- test_kernel_composes_source_and_interpreter_runtime_exceptions · function · L1450-L1488 — def test_kernel_composes_source_and_interpreter_runtime_exceptions( monkeypatch, tmp_path )
- FakeSandbox · class · L1464-L1468 — class FakeSandbox
- close · method · L1467-L1468 — def close(self)
- create · function · L1470-L1472 — def create(_workspace, *, read_isolation)
- test_composed_runtime_below_system_temp_remains_exactly_readable · function · L1491-L1523 — def test_composed_runtime_below_system_temp_remains_exactly_readable( monkeypatch, tmp_path )
- test_team_private_temp_rejects_a_symlinked_root · function · L1526-L1542 — def test_team_private_temp_rejects_a_symlinked_root(tmp_path)
- test_successful_self_test_enables_seatbelt_and_private_temp · function · L1545-L1571 — def test_successful_self_test_enables_seatbelt_and_private_temp(tmp_path)
- test_auto_self_test_failure_falls_back_and_enforce_fails_closed · function · L1574-L1594 — def test_auto_self_test_failure_falls_back_and_enforce_fails_closed(tmp_path)
- test_facility_failure_and_warning_are_cached_process_wide · function · L1597-L1628 — def test_facility_failure_and_warning_are_cached_process_wide(tmp_path, monkeypatch)
- unavailable · function · L1600-L1607 — def unavailable(command, **kwargs)
- test_invalid_mode_is_never_silently_downgraded · function · L1632-L1634 — def test_invalid_mode_is_never_silently_downgraded(tmp_path, value)
- _RecordingSandbox · class · L1637-L1665 — class _RecordingSandbox
- init · method · L1638-L1652 — def init(self, temp_dir: Path)
- wrap_command · method · L1654-L1656 — def wrap_command(self, command)
- apply_environment · method · L1658-L1662 — def apply_environment(self, environment)
- close · method · L1664-L1665 — def close(self)
- test_manager_wraps_spawn_without_changing_frame_or_rpc_loop · function · L1668-L1696 — def test_manager_wraps_spawn_without_changing_frame_or_rpc_loop(tmp_path)
- test_raw_network_environment_flag_is_strict · function · L1699-L1704 — def test_raw_network_environment_flag_is_strict(tmp_path, monkeypatch)
- test_raw_network_environment_flag_is_reflected_in_status · function · L1707-L1720 — def test_raw_network_environment_flag_is_reflected_in_status(tmp_path, monkeypatch)