PopenPlugin¶
PopenPlugin
¶
Bases: StateMachinePlugin
Popen interception plugin.
Replaces subprocess.Popen with _FakePopen at activate() time and restores the original at deactivate() time. Uses reference counting so nested sandboxes work correctly.
States: created -> running -> terminated
Coexists with SubprocessPlugin: SubprocessPlugin patches subprocess.run and shutil.which; PopenPlugin patches subprocess.Popen. Both plugins target independent names in the subprocess module and restore correctly.
Source code in src/tripwire/plugins/popen_plugin.py
install_patches
¶
Install subprocess.Popen patch.
Source code in src/tripwire/plugins/popen_plugin.py
restore_patches
¶
Restore original subprocess.Popen.
Source code in src/tripwire/plugins/popen_plugin.py
check_conflicts
¶
Verify subprocess.Popen has not been patched by a third party.
Source code in src/tripwire/plugins/popen_plugin.py
matches
¶
Field-by-field comparison with dirty-equals support.
Source code in src/tripwire/plugins/popen_plugin.py
assertable_fields
¶
Return assertable fields for each step type.