File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1030,11 +1030,11 @@ jobs:
10301030 fi
10311031
10321032 case "$ENGINE" in
1033- Scapy) TEST_PATHS="tests/toolkit/test_scapy_unit.py tests/foundation/engines/test_scapy_engine.py tests/protocols/transport/test_sctp_unit.py" ;;
1034- PyShark) TEST_PATHS="tests/toolkit/test_pyshark_unit.py tests/foundation/engines/test_pyshark_engine.py" ;;
1035- PyPCAPFile) TEST_PATHS="tests/toolkit/test_pypcapfile_unit.py tests/foundation/engines/test_pypcapfile_engine.py" ;;
1036- PyPCAP) TEST_PATHS="tests/toolkit/test_pypcap_unit.py tests/foundation/engines/test_pypcap_engine.py tests/foundation/engines/test_pcap_backend.py" ;;
1037- PCAP_CT) TEST_PATHS="tests/toolkit/test_pcap_ct_unit.py tests/foundation/engines/test_pcap_ct_engine.py tests/foundation/engines/test_pcap_backend.py" ;;
1033+ Scapy) TEST_PATHS="tests/toolkit/test_scapy_unit.py tests/foundation/engines/test_scapy_engine.py tests/protocols/transport/test_sctp_unit.py tests/foundation/engines/test_engine_verbose_callback_1874_unit.py " ;;
1034+ PyShark) TEST_PATHS="tests/toolkit/test_pyshark_unit.py tests/foundation/engines/test_pyshark_engine.py tests/foundation/engines/test_engine_verbose_callback_1874_unit.py " ;;
1035+ PyPCAPFile) TEST_PATHS="tests/toolkit/test_pypcapfile_unit.py tests/foundation/engines/test_pypcapfile_engine.py tests/foundation/engines/test_engine_verbose_callback_1874_unit.py " ;;
1036+ PyPCAP) TEST_PATHS="tests/toolkit/test_pypcap_unit.py tests/foundation/engines/test_pypcap_engine.py tests/foundation/engines/test_pcap_backend.py tests/foundation/engines/test_engine_verbose_callback_1874_unit.py " ;;
1037+ PCAP_CT) TEST_PATHS="tests/toolkit/test_pcap_ct_unit.py tests/foundation/engines/test_pcap_ct_engine.py tests/foundation/engines/test_pcap_backend.py tests/foundation/engines/test_engine_verbose_callback_1874_unit.py " ;;
10381038 esac
10391039 echo "Running: $TEST_PATHS"
10401040 # shellcheck disable=SC2086
Original file line number Diff line number Diff line change @@ -512,9 +512,13 @@ The following code snippet shows how to create a new engine class:
512512 # check if there's any extraction protocol and/or layer thresholds
513513 # set by the user (some engines may not support this feature); or
514514 # to set up the verbose handler for the underlying engine module,
515- # as in the following code snippet.
515+ # as in the following code snippet. Install it only when the user
516+ # asked for the default output, i.e., `verbose=True`, which sets
517+ # `ext._vfunc_default`: a callable given as `verbose=` is the
518+ # user's own handler, already stored as `ext._vfunc`, so it must
519+ # be kept rather than replaced.
516520
517- if ext._flag_v : # check if verbose mode is enabled
521+ if ext._vfunc_default : # check if the default verbose output is requested
518522 # NOTE : PyPCAPKit has its own bundled supporting functions for
519523 # third-party libraries, e.g., the `packet2chain` function is
520524 # to convert a given Packet instance of the Scapy library to a
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ and extracts parameters from a PCAP file.
8989
9090 .. autoattribute :: _eof_mark
9191 .. autoattribute :: _vfunc
92+ .. autoattribute :: _vfunc_default
9293
9394 .. autoattribute :: _exnam
9495 .. autoattribute :: _exeng
Original file line number Diff line number Diff line change @@ -2410,7 +2410,8 @@ def test_a_commented_out_test_paths_arm_does_not_silently_win(self) -> None:
24102410
24112411 """
24122412 live = ('PyShark) TEST_PATHS="tests/toolkit/test_pyshark_unit.py '
2413- 'tests/foundation/engines/test_pyshark_engine.py" ;;' )
2413+ 'tests/foundation/engines/test_pyshark_engine.py '
2414+ 'tests/foundation/engines/test_engine_verbose_callback_1874_unit.py" ;;' )
24142415 doctored = doctored_workflow (
24152416 self ,
24162417 live ,
@@ -2422,7 +2423,8 @@ def test_a_commented_out_test_paths_arm_does_not_silently_win(self) -> None:
24222423 pyshark_jobs = [job for job in jobs if job .name == 'engine-tests' and 'PyShark' in job .extras ]
24232424 self .assertEqual (len (pyshark_jobs ), 1 )
24242425 self .assertEqual (pyshark_jobs [0 ].paths , ('tests/toolkit/test_pyshark_unit.py' ,
2425- 'tests/foundation/engines/test_pyshark_engine.py' ))
2426+ 'tests/foundation/engines/test_pyshark_engine.py' ,
2427+ 'tests/foundation/engines/test_engine_verbose_callback_1874_unit.py' ))
24262428
24272429 def test_the_undoctored_workflow_produces_no_unexplained_gap (self ) -> None :
24282430 """The control: the tests above fail for the doctoring, not by default."""
You can’t perform that action at this time.
0 commit comments