ab network: the probe uses the lab TURN's credential so the relay is really made; the fake TURN refuses a request whose integrity is wrong; the udp leaf counts STUN transactions, and a transaction over the engine's 7 transmits is a problem
This commit is contained in:
1 parent
a9e56c0b21
commit
0a031d2688
5 files changed
+326
-24
No files matched your search
@@ -14,8 +14,8 @@
|
||||
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 7, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4: every step as stock, and every page left only once its noise is done), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 7 = 3 + 4 (the last two: a `load` that takes 20 s is a step that succeeds, and a `load` that never comes ends in an error that names the wait and the page). Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY).", "stock_firefox": true, "extra_steps": ["fakeweb_profiles"]},
|
||||
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 2, "exact": true, "tests": ["tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the parent of the engine shows <GRE>/fonts to it (FcConfigAppFontAddDir) to rebuild a font from a path and a face index. On Windows DirectWrite opens the file from its path, with no folder to scan and no cache to read, so this test has no Windows counterpart.", "note": "2 = (1) the stand-in that runs the engine under strace stays in the engine's place, as the core launches it (the leader of a process group of its own): a fake engine with a child, no browser; the process the launcher holds lives as long as the fake engine, and the group killed holds strace and the child (the stand-in that exec'd setsid forked and exited 0 at once: candidate 44161687675); (2) the warm launch of the parent reads the bundle from fontconfig's cache and does not scan it again (from firefox-66, engine_at_least). Two launches under strace with the same XDG_CACHE_HOME of the test, the first cold and the second warm: the cold parent opens every font file of <GRE>/fonts (the folder as the disk lists it) before any page and fontconfig writes its cache; the warm parent does not open every one of them, and it opens a *.cache-* file of fontconfig (a few files are opened to be used, so the verdict asks about the whole folder, as a scan does). Scan and drawing are told apart by position: only what the parent opens before the first page counts (the opens that draw are written as after_startup). Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-cache: the interval and the number of opens of the bundle, the names of the files of the bundle each launch opened before the first page, the size of the cache file, the VmRSS of the parent after about:blank and after a page with every family, and a third launch with gfx.bundled-fonts.activate=0 (the behaviour before), which is evidence only. Needs strace on the runner: without it both are red, not skipped. No threshold."},
|
||||
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 30, "exact": true, "tests": ["tests/test_the_page_bytes_reference_compares_decoded_pixels.py"], "marker": "unit", "needs_root": false, "note": "The helpers of wrapper.e2e.compositing on known inputs, no browser: the PNG compared on decoded pixels (another deBG chunk and compression are the same, one pixel is not, every scanline filter), the comparison with a reference (changed, missing and extra keys named, the entry to record), the type of an engine process, an engine process known by its executable and not by the name it gives itself (Linux), and the CPU of a window, and the shape of the committed Windows reference, and the box cut out of a screenshot (its pixels, a box outside the picture refused, written as a PNG and read back, two boxes told apart by a pixel that is named, the pixels that are not grey)."},
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 3757, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_every_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fakeweb_stock_unsettled.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_glean_ready.py", "teLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 3761, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_every_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fakeweb_stock_unsettled.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_glean_ready.py",Line truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 3757, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_every_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fakeweb_stock_unsettled.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoiLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 3761, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_every_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fakeweb_stock_unsettled.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_Line truncated
|
||||
{"id": "wrapper.e2e.securitystate", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_security_state_engine_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The security state the core declares, against the engine: the engine launched directly in its generate mode makes what it is given (the contract's result, security_state/ with the bytes of the full filter and of the delta, the core's own validation of it); a normal launch declares no pref of the mode and re-imports nothing; a certificate that Mozilla's CRLite test data say is revoked in a delta is refused at the first navigation (SEC_ERROR_REVOKED_CERTIFICATE) while a valid one loads, and the revoked one loads when the ready directory has no data; a ready directory with no or an empty security_state/ starts. Certificates made on the run (a fresh root trusted in cert9.db by the engine's own xpcshell, Mozilla's default test key as the key of CN=int), servers on loopback, no network. Red on firefox-67 (no generate mode).", "core_dumps": "invpw-cores"},
|
||||
{"id": "wrapper.e2e.suite.linux.1", "giro": "G2", "os": ["linux"], "min_tests": 415, "exact": true, "tests": ["tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_declared_host_network_e2e.py", "tests/test_detectors_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_element_screenshot_e2e.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_display_linux.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_ignore_https_errors_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_navigation_response.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_oop_frame_element.py", "tests/test_oop_frame_geometry.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_screencast.py", "tests/test_screencast_stop_e2e.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_offline_e2e.py", "tests/test_shadow_trusted_input.py", "tests/test_strict_and_force.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_a_launch_scans_no_process_of_the_machine", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_after_close_no_process_of_the_session_is_left", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_ua_widget_not_selectable.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_Line truncated
|
||||
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 414, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 564 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapLine truncated
|
||||
|
||||
+57
-10
@@ -89,7 +89,8 @@ HUNT_SUMMARY_FORMAT = "ab-network-hunt-summary/1"
|
||||
#: The environment variable that makes ``ab`` repeat one walk of one seed and nothing else (``cmd_hunt``): ``webrtc:<seed>:<n>``.
|
||||
HUNT_ENV = "AB_NETWORK_HUNT"
|
||||
#: The engine's own log in a hunt (the launch's environment, in hunt mode only): nICEr's reasons for accepting or rejecting an answer or ending a transaction, and the signaling.
|
||||
HUNT_MOZ_LOG = "nicer:5,signaling:5,timestamp"
|
||||
#: ``sync`` makes each line reach the file as it is written, so a process that ends (or is killed) loses none.
|
||||
HUNT_MOZ_LOG = "sync,timestamp,nicer:5,signaling:5"
|
||||
VOLATILE_FORMAT = "ab-network-volatile/1"
|
||||
VOLATILE_FILE = ROOT / "ci" / "ab-network-volatile.json"
|
||||
SEEDS_FILE = ROOT / "ci" / "persona-seeds.json"
|
||||
@@ -97,6 +98,11 @@ SEEDS_FILE = ROOT / "ci" / "persona-seeds.json"
|
||||
FALLBACK_SEEDS = (11, 12, 13)
|
||||
ENGINE_TAG = "firefox-68"
|
||||
CANDIDATE = "candidate"
|
||||
#: The most times the engine sends one STUN request (a transmit and its retransmissions) before it gives the transaction up: the pref
|
||||
#: ``media.peerconnection.ice.stun_client_maximum_transmits`` (modules/libpref/init/all.js), 7. The first RTO is 100 ms and doubles, so how
|
||||
#: MANY transactions a walk has is the engine's and is compared, and how many datagrams each took is the network's timing and is not: a
|
||||
#: transaction over this number is a problem of the run (``udp_summary``'s ``over_limit``, ``_udp_overruns``), never a compared leaf.
|
||||
STUN_MAX_TRANSMITS = 7
|
||||
#: What a leaf that one side does not have reads as.
|
||||
MISSING = "<missing>"
|
||||
#: A value longer than this in diff.json is replaced by its length and its sha256.
|
||||
@@ -278,6 +284,25 @@ def _udp_attribution(la: Dict[str, Any], lb: Dict[str, Any]) -> Tuple[set, List[
|
||||
return paths, differences, unattributed
|
||||
|
||||
|
||||
_UDP_OVER_LIMIT = re.compile(r"^(?P<where>.*/udp)/over_limit/(?P<target>[^/]+)/\d+$")
|
||||
|
||||
|
||||
def _udp_overruns(la: Dict[str, Any], lb: Dict[str, Any], label_a: str, label_b: str) -> Tuple[set, List[str]]:
|
||||
"""The STUN transactions that were sent more times than the engine's maximum (``udp_summary``'s ``over_limit``: per destination, the number of transmits of each such
|
||||
transaction). They are not compared leaf by leaf: how many datagrams a transaction took is the network's timing, but more than the engine's own maximum is not
|
||||
timing, it is a client that does not stop. Returns the paths that take part and one problem line for each."""
|
||||
paths: set = set()
|
||||
problems: List[str] = []
|
||||
for label, leaves in ((label_a, la), (label_b, lb)):
|
||||
for path, value in sorted(leaves.items()):
|
||||
m = _UDP_OVER_LIMIT.match(path)
|
||||
if m:
|
||||
paths.add(path)
|
||||
problems.append("%s: a STUN transaction to %s was sent %s times, more than the engine's maximum of %d transmits (%s)"
|
||||
% (label, m.group("target"), value, STUN_MAX_TRANSMITS, m.group("where")))
|
||||
return paths, problems
|
||||
|
||||
|
||||
def exit_lines(transcript: Dict[str, Any], label: str, side: str) -> List[str]:
|
||||
"""The red lines of the launches of one side that did not end with 0 (``exits``, which ``run`` writes: scripts/ci_crash_evidence.py). A transcript that has no ``exits``
|
||||
was not made by ``run`` and says nothing about it; one that has it and no launch in it is a run whose probe saw no browser, which is red."""
|
||||
@@ -297,7 +322,8 @@ def compare_transcripts(a: Dict[str, Any], b: Dict[str, Any], volatile: List[Dic
|
||||
run the same seeds, when fewer than ``floor`` leaves were compared, or when an entry of the volatile list matches no leaf of either transcript (``stale``)."""
|
||||
la, lb = flatten(a.get("seeds") or {}), flatten(b.get("seeds") or {})
|
||||
attribution, attribution_differences, unattributed = _udp_attribution(la, lb)
|
||||
paths = sorted((set(la) | set(lb)) - attribution)
|
||||
overrun_paths, overruns = _udp_overruns(la, lb, label_a, label_b)
|
||||
paths = sorted((set(la) | set(lb)) - attribution - overrun_paths)
|
||||
problems: List[str] = []
|
||||
if set(a.get("seeds") or {}) != set(b.get("seeds") or {}):
|
||||
problems.append("the sides ran different seeds: %s and %s" % (sorted(a.get("seeds") or {}), sorted(b.get("seeds") or {})))
|
||||
@@ -335,6 +361,7 @@ def compare_transcripts(a: Dict[str, Any], b: Dict[str, Any], volatile: List[Dic
|
||||
problems += ["a direct connection: " + d for d in direct]
|
||||
problems += exit_lines(a, label_a, "A") + exit_lines(b, label_b, "B")
|
||||
problems += invariants
|
||||
problems += overruns
|
||||
problems += ["the volatile entry %r matches no leaf of either transcript: it is stale, drop it" % p for p in stale]
|
||||
problems += ["%s: %s %s | %s %s" % (d["path"], label_a, json.dumps(d["a"], sort_keys=True)[:160], label_b, json.dumps(d["b"], sort_keys=True)[:160])
|
||||
for d in differences]
|
||||
@@ -479,17 +506,31 @@ def dns_summary(queries: List[Tuple[str, int, str]], openers: Optional[List[Opti
|
||||
|
||||
|
||||
def udp_summary(events: List[Dict[str, Any]], norm: Normalizer) -> Dict[str, Any]:
|
||||
"""The datagrams the relay carried in one phase: per destination, the kinds of message and how many."""
|
||||
"""The datagrams the relay carried in one phase: per destination, the kinds of message and how many.
|
||||
|
||||
``counts`` is the number of STUN TRANSACTIONS (distinct transaction ids) per destination, plus one for each datagram that is not STUN: a retransmission carries the
|
||||
transaction id of the request it repeats, and how many times a request is repeated is the timing of the network (the first RTO is 100 ms and doubles; a late answer
|
||||
on a loaded host adds one), so it is not what the engine decides. ``over_limit`` (only when there is one) lists, per destination, the transmits of each transaction
|
||||
that has more than ``STUN_MAX_TRANSMITS``: ``compare_transcripts`` reports it as a problem and never compares it."""
|
||||
kinds: Dict[str, set] = collections.defaultdict(set)
|
||||
counts: collections.Counter = collections.Counter()
|
||||
transmits: Dict[str, collections.Counter] = collections.defaultdict(collections.Counter)
|
||||
plain: collections.Counter = collections.Counter()
|
||||
order: List[str] = []
|
||||
for e in events:
|
||||
target = norm.text(e["target"])
|
||||
if target not in kinds:
|
||||
order.append(target)
|
||||
kinds[target].add(e["message"])
|
||||
counts[target] += 1
|
||||
out: Dict[str, Any] = {"order": order, "messages": {t: sorted(kinds[t]) for t in sorted(kinds)}, "counts": dict(sorted(counts.items()))}
|
||||
if e.get("tid") is None:
|
||||
plain[target] += 1
|
||||
else:
|
||||
transmits[target][e["tid"]] += 1
|
||||
counts = {t: plain[t] + len(transmits[t]) for t in sorted(kinds)}
|
||||
out: Dict[str, Any] = {"order": order, "messages": {t: sorted(kinds[t]) for t in sorted(kinds)}, "counts": counts}
|
||||
over = {t: sorted((n for n in transmits[t].values() if n > STUN_MAX_TRANSMITS), reverse=True) for t in sorted(kinds)}
|
||||
over = {t: v for t, v in over.items() if v}
|
||||
if over:
|
||||
out["over_limit"] = over
|
||||
who = _openers([norm.text(e["target"]) for e in events], [e.get("opener") for e in events])
|
||||
if who:
|
||||
out["openers"] = who
|
||||
@@ -923,6 +964,7 @@ def make_lab_classes() -> Tuple[type, type, type]:
|
||||
self.seen: list = []
|
||||
self.allocations: list = []
|
||||
self.requests: list = []
|
||||
self.refused: list = []
|
||||
self._closed = False
|
||||
threading.Thread(target=self._serve, daemon=True).start()
|
||||
|
||||
@@ -975,11 +1017,14 @@ STUN_URL = "stun:198.51.100.5:19302"
|
||||
TURN_URL = "turn:198.51.100.7:3478?transport=udp"
|
||||
#: The TURN server of ``TURN_URL`` as the gateway names the target of a datagram (a test holds it equal to ``tests/_turn_chain.py``).
|
||||
TURN_TARGET = "198.51.100.7:3478"
|
||||
#: The probe of the WebRTC page: one STUN and one TURN server by address (the relay answers both), a data channel, and the page waits for the end of the gather (the
|
||||
#: The user name the probe gives the TURN server (the lab's server takes any: the key is made from it and the password of ``tests/_turn_chain.py``, which the walk passes as the credential).
|
||||
TURN_USERNAME = "lab"
|
||||
#: The probe of the WebRTC page: one STUN and one TURN server by address (the relay answers both; the TURN's user name and credential are its arguments, never written here), a data channel, and the page waits for the end of the gather (the
|
||||
#: timer is the safety net of a gather that never ends, not a measure of it).
|
||||
RTC_JS = r"""async (urls) => {
|
||||
RTC_JS = r"""async (args) => {
|
||||
const [stunUrl, turnUrl, username, credential] = args;
|
||||
const T = {start: performance.now(), offer: null, local: null, candidates: [], errors: [], gathered: null, closing: null, closed: null};
|
||||
const pc = new RTCPeerConnection({iceServers: [{urls: [urls[0]]}, {urls: [urls[1]], username: 'lab', credential: 'lab'}]});
|
||||
const pc = new RTCPeerConnection({iceServers: [{urls: [stunUrl]}, {urls: [turnUrl], username, credential}]});
|
||||
pc.createDataChannel('');
|
||||
const cands = [], errors = [];
|
||||
pc.addEventListener('icecandidate', e => {
|
||||
@@ -1541,13 +1586,15 @@ def walk_h3(browser: Any, lab: Lab, guard_ms: int = LEAVE_GUARD_MS) -> Dict[str,
|
||||
|
||||
|
||||
def walk_webrtc(browser: Any, lab: Lab) -> Dict[str, Any]:
|
||||
from _turn_chain import PASSWORD as TURN_PASSWORD # the one the lab's TURN server signs its answers with: a browser with another finds every success invalid and makes no relay
|
||||
|
||||
lab.rec.set_phase("webrtc")
|
||||
context = browser.new_context(ignore_https_errors=True)
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto("http://%s:%d/rtc" % (PAGE_NAME, lab.site.port), wait_until="load", timeout=60000)
|
||||
lab.webrtc["evaluate"] = {"called": lab.rec.now()}
|
||||
result = page.evaluate(RTC_JS, [STUN_URL, TURN_URL])
|
||||
result = page.evaluate(RTC_JS, [STUN_URL, TURN_URL, TURN_USERNAME, TURN_PASSWORD])
|
||||
lab.webrtc["evaluate"]["returned"] = lab.rec.now()
|
||||
finally:
|
||||
context.close()
|
||||
|
||||
+42
-5
@@ -111,11 +111,36 @@ def _message(mtype: int, tid: bytes, attrs: bytes, key: Optional[bytes] = None)
|
||||
return head + attrs + _attr(0x0008, mac)
|
||||
|
||||
|
||||
def long_term_key(user: str) -> bytes:
|
||||
"""The long-term credential key of RFC 5389 section 15.4: md5(username:realm:password)."""
|
||||
return hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
|
||||
|
||||
def integrity_valid(data: bytes, user: str) -> bool:
|
||||
"""Whether the MESSAGE-INTEGRITY of a request is the HMAC-SHA1 under the long-term key of ``user`` (RFC 5389 section 15.4): over the message up to the
|
||||
attribute, with the length field of the header set as if the message ended with that attribute (24 bytes more than what came before it). A request
|
||||
with no MESSAGE-INTEGRITY, or a truncated one, is not valid."""
|
||||
i = 20
|
||||
while i + 4 <= len(data):
|
||||
t, n = struct.unpack("!HH", data[i:i + 4])
|
||||
if t == 0x0008:
|
||||
if n != 20 or i + 24 > len(data):
|
||||
return False
|
||||
head = data[:2] + struct.pack("!H", i + 24 - 20) + data[4:20]
|
||||
return hmac.compare_digest(hmac.new(long_term_key(user), head + data[20:i], hashlib.sha1).digest(), data[i + 4:i + 24])
|
||||
i += 4 + ((n + 3) & ~3)
|
||||
return False
|
||||
|
||||
|
||||
class TurnServer:
|
||||
"""UDP TURN server on 127.0.0.1. ``seen`` is every datagram as (source ip, source port, STUN type), in order;
|
||||
``requests`` the same datagrams as (monotonic time, transaction id, STUN type, carries credentials): a retransmission has the
|
||||
transaction id of the request it repeats, so the TRANSACTIONS of a road are the distinct ids (:meth:`transactions`);
|
||||
``allocations`` the successful Allocates as (source ip, source port, username, time)."""
|
||||
``allocations`` the successful Allocates as (source ip, source port, username, time).
|
||||
|
||||
A request that carries USERNAME is checked: its MESSAGE-INTEGRITY must be the HMAC under the long-term key of that user (``PASSWORD``).
|
||||
A missing or wrong one is answered 401 with the realm and the nonce, makes no allocation, and is written in ``refused`` as
|
||||
(source ip, source port, username, transaction id, time): a client with the wrong password never gets a relay here, as on a real server."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
@@ -124,6 +149,7 @@ class TurnServer:
|
||||
self.seen: List[Tuple[str, int, int]] = []
|
||||
self.allocations: List[Tuple[str, int, str, float]] = []
|
||||
self.requests: List[Tuple[float, bytes, int, bool]] = []
|
||||
self.refused: List[Tuple[str, int, str, bytes, float]] = []
|
||||
self._closed = False
|
||||
threading.Thread(target=self._serve, daemon=True).start()
|
||||
|
||||
@@ -151,23 +177,34 @@ class TurnServer:
|
||||
self.seen.append((src[0], src[1], mtype))
|
||||
attrs = _attrs(data)
|
||||
self.requests.append((time.monotonic(), tid, mtype, 0x0008 in attrs and 0x0006 in attrs))
|
||||
user_raw = attrs.get(0x0006)
|
||||
if mtype in (0x0003, 0x0004, 0x0008, 0x0009) and user_raw is not None:
|
||||
user = user_raw.decode(errors="replace")
|
||||
if not integrity_valid(data, user): # the wrong password, or no MESSAGE-INTEGRITY: 401, no allocation
|
||||
self.refused.append((src[0], src[1], user, tid, time.monotonic()))
|
||||
self.sock.sendto(_message(mtype | 0x0110, tid, self._unauthorized()), src)
|
||||
continue
|
||||
if mtype == 0x0003: # Allocate
|
||||
if 0x0008 not in attrs or 0x0006 not in attrs: # no credentials: 401 with a realm and a nonce
|
||||
err = _attr(0x0009, b"\x00\x00\x04\x01Unauthorized") + _attr(0x0014, REALM.encode()) + _attr(0x0015, NONCE.encode())
|
||||
self.sock.sendto(_message(0x0113, tid, err), src)
|
||||
self.sock.sendto(_message(0x0113, tid, self._unauthorized()), src)
|
||||
continue
|
||||
user = attrs[0x0006].decode(errors="replace")
|
||||
key = hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
key = long_term_key(user)
|
||||
body = (_attr(0x0016, _xor_addr(*RELAYED)) + _attr(0x0020, _xor_addr(src[0], src[1])) +
|
||||
_attr(0x000D, struct.pack("!I", 600)))
|
||||
self.allocations.append((src[0], src[1], user, time.monotonic()))
|
||||
self.sock.sendto(_message(0x0103, tid, body, key), src)
|
||||
elif mtype in (0x0004, 0x0008, 0x0009): # Refresh, CreatePermission, ChannelBind
|
||||
user = attrs.get(0x0006, b"").decode(errors="replace")
|
||||
key = hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
key = long_term_key(user)
|
||||
body = _attr(0x000D, struct.pack("!I", 600)) if mtype == 0x0004 else b""
|
||||
self.sock.sendto(_message(mtype | 0x0100, tid, body, key), src)
|
||||
|
||||
@staticmethod
|
||||
def _unauthorized() -> bytes:
|
||||
"""The attributes of a 401: ERROR-CODE, the realm and the nonce of the long-term credential."""
|
||||
return _attr(0x0009, b"\x00\x00\x04\x01Unauthorized") + _attr(0x0014, REALM.encode()) + _attr(0x0015, NONCE.encode())
|
||||
|
||||
|
||||
# ── the gateway ────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
"""The probe of the WebRTC walk must hold the credential the lab's TURN server signs with, and the A/A must not count retransmissions (scripts/ci_ab_network.py, tests/_turn_chain.py), no browser.
|
||||
|
||||
Two defects of the oracle, each held here:
|
||||
|
||||
* The probe gave the TURN server ``lab``/``lab`` while the server signs its answers with the long-term key of its own password: the browser found the MESSAGE-INTEGRITY of every
|
||||
Allocate success invalid, dropped it, retransmitted up to the engine's maximum and ended in error 701, so no relay candidate was ever made. And the fake server never checked the
|
||||
request's own MESSAGE-INTEGRITY, so it "allocated" for a client with the wrong password. The probe now takes the credential as an argument (the walk passes the server's own
|
||||
constant) and the server refuses a request whose integrity is wrong, as a real one does.
|
||||
* The leaf ``seeds/<seed>/webrtc/udp/counts/<target>`` counted DATAGRAMS. A retransmission is network timing (the first RTO is 100 ms and doubles; a late 401 on a loaded host adds
|
||||
one), so 1+7 became 2+7 and the A/A of one engine read 8 against 9. The leaf now counts STUN TRANSACTIONS; a transaction with more transmits than the engine's maximum is a problem
|
||||
of the run, not a compared leaf.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import hmac
|
||||
import inspect
|
||||
import json
|
||||
import re
|
||||
import socket
|
||||
import struct
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _turn_chain # noqa: E402
|
||||
import ci_ab_network as ab # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
COOKIE = 0x2112A442
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the count of transactions
|
||||
def walk_transcript(label, tids):
|
||||
"""A transcript of seed 4 whose WebRTC walk sent ``tids`` (one entry per datagram, in order) to the TURN server, summarised as ``run`` summarises them."""
|
||||
events = [{"target": ab.TURN_TARGET, "message": "stun-0x0003", "tid": tid, "opener": None} for tid in tids]
|
||||
return {"format": ab.FORMAT, "label": label, "platform": "linux",
|
||||
"seeds": {"4": {"webrtc": {"candidates": ["udp comp1 prio1 relay <exit>"], "gathering": "complete", "udp": ab.udp_summary(events, ab.Normalizer({}))}}}}
|
||||
|
||||
|
||||
A, B = "aa" * 12, "bb" * 12
|
||||
#: The recorded shape: the first Allocate once and the second seven times, against the first twice (a late 401) and the second seven times.
|
||||
FIRST_RUN, SECOND_RUN = [A] + [B] * 7, [A] * 2 + [B] * 7
|
||||
|
||||
|
||||
def test_a_late_401_that_adds_a_retransmission_is_not_a_difference_of_the_engine():
|
||||
a, b = walk_transcript("a", FIRST_RUN), walk_transcript("b", SECOND_RUN)
|
||||
assert len(FIRST_RUN) == 8 and len(SECOND_RUN) == 9, "the recorded 8 against 9"
|
||||
counts = lambda t: t["seeds"]["4"]["webrtc"]["udp"]["counts"][ab.TURN_TARGET] # noqa: E731
|
||||
assert (counts(a), counts(b)) == (2, 2), "two transactions on both sides"
|
||||
report = ab.compare_transcripts(a, b, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and report["problems"] == [] and report["verdict"] == "green"
|
||||
|
||||
|
||||
def test_a_transaction_that_one_run_did_not_make_is_still_a_difference():
|
||||
a = walk_transcript("a", FIRST_RUN)
|
||||
c = walk_transcript("c", [A] + [B] * 7 + ["cc" * 12]) # a third transaction: the engine asked for something more
|
||||
report = ab.compare_transcripts(a, c, [], 0, "a", "c")
|
||||
assert [d["path"] for d in report["differences"]] == ["seeds/4/webrtc/udp/counts/%s" % ab.TURN_TARGET]
|
||||
assert (report["differences"][0]["a"], report["differences"][0]["b"]) == (2, 3) and report["verdict"] == "red"
|
||||
|
||||
|
||||
def test_a_datagram_that_is_not_stun_counts_one_each_and_the_messages_and_the_order_are_kept():
|
||||
events = [{"target": "127.0.0.1:5555", "message": "quic-long", "tid": None}] * 3 + [
|
||||
{"target": ab.TURN_TARGET, "message": "stun-0x0003", "tid": A}, {"target": ab.TURN_TARGET, "message": "stun-0x0113", "tid": A}]
|
||||
summary = ab.udp_summary(events, ab.Normalizer({}))
|
||||
assert summary == {"order": ["127.0.0.1:5555", ab.TURN_TARGET], "messages": {"127.0.0.1:5555": ["quic-long"], ab.TURN_TARGET: ["stun-0x0003", "stun-0x0113"]},
|
||||
"counts": {"127.0.0.1:5555": 3, ab.TURN_TARGET: 1}}
|
||||
|
||||
|
||||
def test_the_engines_maximum_is_the_pref_of_the_engine_and_a_transaction_over_it_is_a_problem_while_one_at_it_is_not():
|
||||
assert ab.STUN_MAX_TRANSMITS == 7
|
||||
source = (ROOT / "scripts" / "ci_ab_network.py").read_text(encoding="utf-8")
|
||||
assert "media.peerconnection.ice.stun_client_maximum_transmits" in source and "modules/libpref/init/all.js" in source
|
||||
|
||||
at_most = walk_transcript("a", [A] * 7)
|
||||
assert "over_limit" not in at_most["seeds"]["4"]["webrtc"]["udp"]
|
||||
assert ab.compare_transcripts(at_most, at_most, [], 0, "a", "a")["problems"] == []
|
||||
|
||||
over = walk_transcript("b", [A] * 8)
|
||||
assert over["seeds"]["4"]["webrtc"]["udp"]["over_limit"] == {ab.TURN_TARGET: [8]}
|
||||
report = ab.compare_transcripts(at_most, over, [], 0, "a", "b")
|
||||
assert report["verdict"] == "red" and len(report["problems"]) == 1 and "8 times" in report["problems"][0] and "maximum of 7" in report["problems"][0]
|
||||
assert report["problems"][0].startswith("b: ") and report["differences"] == [], "a problem of the run, not a compared leaf"
|
||||
both = ab.compare_transcripts(over, over, [], 0, "a", "b")
|
||||
assert len(both["problems"]) == 2 and both["differences"] == [], "each side that did it is named"
|
||||
|
||||
|
||||
def test_the_a_a_prints_a_transaction_over_the_maximum_as_a_fail_line_and_counts_it_among_the_problems(capsys):
|
||||
over = walk_transcript("a", [A] * 8)
|
||||
report = ab.compare_transcripts(over, walk_transcript("b", [A] * 7), [], 0, "a", "b")
|
||||
ab.print_report(report, True)
|
||||
out = capsys.readouterr().out
|
||||
assert re.search(r"^FAIL a: a STUN transaction to 198\.51\.100\.7:3478 was sent 8 times, more than the engine's maximum of 7 transmits", out, re.M), out
|
||||
assert "AB NETWORK A/A FAILED: 0 differences, 1 problems" in out and "\nDIFF " not in "\n" + out
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the credential of the probe
|
||||
def test_the_probe_has_no_credential_written_in_it_and_the_walk_passes_the_one_of_the_lab_server():
|
||||
js = ab.RTC_JS
|
||||
assert not re.search(r"""credential\s*:\s*['"]""", js) and not re.search(r"""username\s*:\s*['"]""", js), "no literal credential or user name in the page's script"
|
||||
assert "'lab'" not in js and _turn_chain.PASSWORD not in js
|
||||
assert "async (args) =>" in js and "const [stunUrl, turnUrl, username, credential] = args;" in js
|
||||
assert "{urls: [turnUrl], username, credential}" in js and "{urls: [stunUrl]}" in js, "the STUN entry has no credential, the TURN entry has the arguments"
|
||||
walk = inspect.getsource(ab.walk_webrtc)
|
||||
assert "from _turn_chain import PASSWORD" in walk and "[STUN_URL, TURN_URL, TURN_USERNAME, TURN_PASSWORD]" in walk
|
||||
assert _turn_chain.PASSWORD not in (ROOT / "scripts" / "ci_ab_network.py").read_text(encoding="utf-8"), "the password is written once, in tests/_turn_chain.py"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the TURN server refuses a wrong integrity
|
||||
def attribute(kind, value):
|
||||
return struct.pack("!HH", kind, len(value)) + value + b"\x00" * (-len(value) % 4)
|
||||
|
||||
|
||||
def signed(mtype, tid, user, password, extra=b""):
|
||||
"""A request as a client builds it (RFC 5389 section 15.4), written here and not taken from the server's module: USERNAME, REALM, NONCE, then MESSAGE-INTEGRITY, the
|
||||
HMAC-SHA1 under md5(user:realm:password) over the message with the length of the header counting the attribute itself."""
|
||||
body = attribute(0x0006, user.encode()) + attribute(0x0014, _turn_chain.REALM.encode()) + attribute(0x0015, _turn_chain.NONCE.encode()) + extra
|
||||
head = struct.pack("!HHI", mtype, len(body) + 24, COOKIE) + tid
|
||||
key = hashlib.md5(("%s:%s:%s" % (user, _turn_chain.REALM, password)).encode(), usedforsecurity=False).digest()
|
||||
return head + body + attribute(0x0008, hmac.new(key, head + body, hashlib.sha1).digest())
|
||||
|
||||
|
||||
def unsigned(mtype, tid):
|
||||
return struct.pack("!HHI", mtype, 0, COOKIE) + tid
|
||||
|
||||
|
||||
def ask(server, request):
|
||||
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
client.settimeout(5)
|
||||
try:
|
||||
client.sendto(request, server.address)
|
||||
answer, _ = client.recvfrom(65536)
|
||||
finally:
|
||||
client.close()
|
||||
return struct.unpack("!H", answer[:2])[0], _turn_chain._attrs(answer)
|
||||
|
||||
|
||||
def error_code(attrs):
|
||||
return attrs[0x0009][2] * 100 + attrs[0x0009][3]
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def turn():
|
||||
server = _turn_chain.TurnServer()
|
||||
try:
|
||||
yield server
|
||||
finally:
|
||||
server.close()
|
||||
|
||||
|
||||
def test_with_the_right_credential_an_allocate_is_answered_401_and_then_with_the_relay_and_nothing_is_refused(turn):
|
||||
kind, attrs = ask(turn, unsigned(0x0003, b"\x01" * 12))
|
||||
assert kind == 0x0113 and error_code(attrs) == 401 and attrs[0x0014] == _turn_chain.REALM.encode() and attrs[0x0015] == _turn_chain.NONCE.encode()
|
||||
kind, attrs = ask(turn, signed(0x0003, b"\x02" * 12, "lab", _turn_chain.PASSWORD))
|
||||
assert kind == 0x0103 and 0x0016 in attrs and 0x0008 in attrs, "the success carries XOR-RELAYED-ADDRESS and is signed"
|
||||
assert [a[2] for a in turn.allocations] == ["lab"] and turn.refused == []
|
||||
assert len(turn.seen) == 2 and [r[3] for r in turn.requests] == [False, True], "requests and seen keep their meaning"
|
||||
|
||||
|
||||
def test_with_a_wrong_credential_both_allocates_are_answered_401_and_nothing_is_allocated(turn):
|
||||
kind, attrs = ask(turn, unsigned(0x0003, b"\x01" * 12))
|
||||
assert kind == 0x0113 and error_code(attrs) == 401
|
||||
kind, attrs = ask(turn, signed(0x0003, b"\x02" * 12, "lab", "not-the-password"))
|
||||
assert kind == 0x0113 and error_code(attrs) == 401 and 0x0016 not in attrs, "no relay for a client with the wrong password"
|
||||
assert attrs[0x0014] == _turn_chain.REALM.encode() and attrs[0x0015] == _turn_chain.NONCE.encode(), "the 401 asks again, with the realm and the nonce"
|
||||
assert turn.allocations == []
|
||||
assert len(turn.refused) == 1 and turn.refused[0][2:4] == ("lab", b"\x02" * 12), turn.refused
|
||||
assert [r[3] for r in turn.requests] == [False, True], "the request still carried credentials: `requests` says what arrived, `refused` what was turned away"
|
||||
|
||||
|
||||
def test_a_request_with_a_user_name_and_no_integrity_or_a_changed_message_is_refused_too(turn):
|
||||
body = attribute(0x0006, b"lab")
|
||||
kind, _ = ask(turn, struct.pack("!HHI", 0x0003, len(body), COOKIE) + b"\x03" * 12 + body)
|
||||
assert kind == 0x0113 and turn.allocations == [] and len(turn.refused) == 1
|
||||
good = signed(0x0003, b"\x04" * 12, "lab", _turn_chain.PASSWORD)
|
||||
tampered = good[:20] + attribute(0x0006, b"lbb") + good[20 + len(attribute(0x0006, b"lab")):]
|
||||
assert len(tampered) == len(good) and ask(turn, tampered)[0] == 0x0113 and turn.allocations == [] and len(turn.refused) == 2
|
||||
assert ask(turn, good)[0] == 0x0103 and len(turn.allocations) == 1
|
||||
|
||||
|
||||
def test_a_refresh_with_a_wrong_integrity_is_refused_and_one_with_the_right_one_is_answered(turn):
|
||||
kind, attrs = ask(turn, signed(0x0004, b"\x05" * 12, "lab", "wrong"))
|
||||
assert kind == 0x0114 and error_code(attrs) == 401 and len(turn.refused) == 1
|
||||
kind, _ = ask(turn, signed(0x0004, b"\x06" * 12, "lab", _turn_chain.PASSWORD))
|
||||
assert kind == 0x0104 and len(turn.refused) == 1 and turn.allocations == []
|
||||
|
||||
|
||||
def test_the_integrity_check_is_the_one_of_rfc_5389_with_the_length_adjusted():
|
||||
good = signed(0x0003, b"\x07" * 12, "lab", _turn_chain.PASSWORD)
|
||||
assert _turn_chain.integrity_valid(good, "lab") and not _turn_chain.integrity_valid(good, "other")
|
||||
# an attribute after MESSAGE-INTEGRITY (a FINGERPRINT) does not change what is signed
|
||||
assert _turn_chain.integrity_valid(good + attribute(0x8028, b"\x00" * 4), "lab")
|
||||
assert not _turn_chain.integrity_valid(unsigned(0x0003, b"\x07" * 12), "lab") and not _turn_chain.integrity_valid(good[:-4], "lab")
|
||||
assert _turn_chain.long_term_key("lab") == hashlib.md5(("lab:%s:%s" % (_turn_chain.REALM, _turn_chain.PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
|
||||
|
||||
def test_the_server_of_the_lab_keeps_the_list_of_refusals_too():
|
||||
_gateway, turn_class, _page = ab.make_lab_classes()
|
||||
server = turn_class("127.0.0.1")
|
||||
try:
|
||||
assert server.refused == [] and isinstance(server, _turn_chain.TurnServer)
|
||||
kind, _ = ask(server, signed(0x0003, b"\x08" * 12, "lab", "wrong"))
|
||||
assert kind == 0x0113 and len(server.refused) == 1 and server.allocations == []
|
||||
kind, _ = ask(server, signed(0x0003, b"\x09" * 12, "lab", _turn_chain.PASSWORD))
|
||||
assert kind == 0x0103 and len(server.allocations) == 1
|
||||
json.dumps(server.exchanges)
|
||||
finally:
|
||||
server.close()
|
||||
@@ -20,6 +20,9 @@ import pytest
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_ab_network as ab # noqa: E402
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _turn_chain # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
@@ -72,9 +75,10 @@ def test_the_gateway_writes_the_transaction_id_of_each_datagram_and_the_summary_
|
||||
assert [(e["target"], e["message"], e["tid"]) for e in events] == [
|
||||
(ab.TURN_TARGET, "stun-0x0003", TID.hex()), (ab.TURN_TARGET, "stun-0x0003", TID.hex()), (ab.TURN_TARGET, "stun-0x0003", "09" * 12), ("127.0.0.1:5555", "quic-long", None)]
|
||||
norm = ab.Normalizer({})
|
||||
# the count is of TRANSACTIONS: the first Allocate was sent twice (one transaction), the second once, and the QUIC datagram has no transaction id (one)
|
||||
assert ab.udp_summary(events, norm)["counts"] == {ab.TURN_TARGET: 2, "127.0.0.1:5555": 1}
|
||||
without = [{k: v for k, v in e.items() if k != "tid"} for e in events]
|
||||
assert ab.udp_summary(events, norm) == ab.udp_summary(without, norm), "the datagram's transaction id is not in what the A/A compares"
|
||||
assert ab.udp_summary(events, norm)["counts"] == {ab.TURN_TARGET: 3, "127.0.0.1:5555": 1}
|
||||
assert ab.udp_summary(without, norm)["counts"] == {ab.TURN_TARGET: 3, "127.0.0.1:5555": 1}, "with no transaction id every datagram counts one"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the evidence key
|
||||
@@ -187,7 +191,7 @@ def test_what_the_page_measures_of_itself_is_in_the_evidence_and_the_summary_of_
|
||||
pass
|
||||
|
||||
def evaluate(self, js, arg):
|
||||
assert js == ab.RTC_JS and arg == [ab.STUN_URL, ab.TURN_URL]
|
||||
assert js == ab.RTC_JS and arg == [ab.STUN_URL, ab.TURN_URL, ab.TURN_USERNAME, _turn_chain.PASSWORD]
|
||||
return json.loads(json.dumps(self.result))
|
||||
|
||||
class Browser:
|
||||
@@ -212,10 +216,10 @@ def test_what_the_page_measures_of_itself_is_in_the_evidence_and_the_summary_of_
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the TURN server's answers and the relay's return path
|
||||
def signed_allocate(tid, user=b"lab"):
|
||||
"""An Allocate with USERNAME and a MESSAGE-INTEGRITY attribute (the server of the lab checks that they are there)."""
|
||||
from _turn_chain import _attr, _message
|
||||
"""An Allocate with USERNAME and the MESSAGE-INTEGRITY of the long-term key (the server of the lab checks it)."""
|
||||
from _turn_chain import _attr, _message, long_term_key
|
||||
|
||||
return _message(0x0003, tid, _attr(0x0006, user) + _attr(0x0008, b"\x00" * 20))
|
||||
return _message(0x0003, tid, _attr(0x0006, user), long_term_key(user.decode()))
|
||||
|
||||
|
||||
def test_the_turn_server_of_the_lab_writes_every_request_with_what_it_carried_and_every_answer_with_where_it_went_and_answers_as_it_always_did():
|
||||
@@ -382,7 +386,7 @@ def test_a_hunt_repetition_launches_the_engine_with_its_own_log_and_the_variable
|
||||
without = ab.hunt_repetition("/e/firefox", "firefox-68", 1, 4, patch)
|
||||
finally:
|
||||
patch.undo()
|
||||
assert seen == [("nicer:5,signaling:5,timestamp", str(tmp_path / "firefox-68-again-7-mozlog")), (None, None)] and ab.HUNT_MOZ_LOG == "nicer:5,signaling:5,timestamp"
|
||||
assert seen == [("sync,timestamp,nicer:5,signaling:5", str(tmp_path / "firefox-68-again-7-mozlog")), (None, None)] and ab.HUNT_MOZ_LOG == "sync,timestamp,nicer:5,signaling:5"
|
||||
assert record["mozlog"] == "firefox-68-again-7-mozlog" and "mozlog" not in without
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user