mirror of
https://github.com/mandiant/capa.git
synced 2026-07-11 22:51:52 -07:00
Test backend option
As `get_extractor` returns only vivisect now, `test_main` is not run for smda. Test that capa works with all backends. It doesn't test that the backend is actually called.
This commit is contained in:
@@ -365,3 +365,17 @@ def test_not_render_rules_also_matched(z9324d_extractor, capsys):
|
||||
assert "act as TCP client" in std.out
|
||||
assert "connect TCP socket" in std.out
|
||||
assert "create TCP socket" in std.out
|
||||
|
||||
|
||||
# It tests main works with different backends. It doesn't test that the backend
|
||||
# is actually called.
|
||||
def test_backend_option(capsys):
|
||||
if sys.version_info > (3, 0):
|
||||
path = get_data_path_by_name("pma16-01")
|
||||
assert capa.main.main([path, "-b", capa.main.BACKEND_VIV]) == 0
|
||||
std = capsys.readouterr()
|
||||
assert "check for PEB NtGlobalFlag flag (24 matches)" in std.out
|
||||
|
||||
assert capa.main.main([path, "-b", capa.main.BACKEND_SMDA]) == 0
|
||||
std = capsys.readouterr()
|
||||
assert "check for PEB NtGlobalFlag flag (24 matches)" in std.out
|
||||
|
||||
Reference in New Issue
Block a user