test: cover participant binding rejection
| | |
| | | "lmDocRollbackCommit": "0cec0c4ffed92f277778adbbd14eea3e5aa562b6", |
| | | "implementationBaseCommit": "afd9833f82e9c1f6d5dfe7f2250f19f1af5cdd7d", |
| | | "implementationBaseTree": "a9af1be31c66740fefe54223e0ea0559b78aaba0", |
| | | "candidateCommit": "cce5655f2f88e6541ba6f70cb68d183beba19ac9", |
| | | "candidateTree": "65acfece24241a5f9fd3cc5a2e3351ed33bb641f", |
| | | "candidateCommit": "ad9ba4c2a439c8ef464e34c19696300519e134b6", |
| | | "candidateTree": "2a3f48f3394e4d87bf8ae59db6bef132f64c7b6a", |
| | | "repairParent": "efc73c570bb70ba4de23afc785350629ef5016a7", |
| | | "buildBoundary": "JENKINS_33_BUILD_ONLY_SUCCESS" |
| | | }, |
| | |
| | | }) |
| | | } |
| | | |
| | | fn is_bound_user_participant(identity: &str, expected: Option<&str>) -> bool { |
| | | expected.is_none_or(|value| identity == value) |
| | | } |
| | | |
| | | async fn observe_user_audio_events( |
| | | mut events: UnboundedReceiver<RoomEvent>, |
| | | call_id: String, |
| | |
| | | publication: _, |
| | | participant, |
| | | } => { |
| | | if user_participant_identity |
| | | .as_deref() |
| | | .is_some_and(|expected| participant.identity().to_string() != expected) |
| | | { |
| | | if !is_bound_user_participant( |
| | | &participant.identity().to_string(), |
| | | user_participant_identity.as_deref(), |
| | | ) { |
| | | warn!(call_id = %call_id, trace_id = %trace_id, |
| | | metadata_status = "wrong_participant", |
| | | "runtime helper ignored non-user audio participant"); |
| | |
| | | } |
| | | |
| | | #[test] |
| | | fn production_observer_rejects_wrong_participant_before_vad_session() { |
| | | assert!(!is_bound_user_participant( |
| | | "participant-other", |
| | | Some("participant-user") |
| | | )); |
| | | assert!(is_bound_user_participant( |
| | | "participant-user", |
| | | Some("participant-user") |
| | | )); |
| | | assert!(is_bound_user_participant("participant-any", None)); |
| | | } |
| | | |
| | | #[test] |
| | | fn reply_chunk_marker_state_emits_turn_first_once_and_later_segment_first_once() { |
| | | let mut state = ReplyChunkMarkerState::default(); |
| | | |