(t *testing.T)
| 329 | } |
| 330 | |
| 331 | func TestMultiNodeRevokePublishPermission(t *testing.T) { |
| 332 | _, _, finish := setupMultiNodeTest("TestMultiNodeRevokePublishPermission") |
| 333 | defer finish() |
| 334 | |
| 335 | for _, testRTCServicePath := range testRTCServicePaths { |
| 336 | t.Run(fmt.Sprintf("testRTCServicePath=%s", testRTCServicePath.String()), func(t *testing.T) { |
| 337 | c1 := createRTCClient("c1", defaultServerPort, testRTCServicePath, nil) |
| 338 | c2 := createRTCClient("c2", secondServerPort, testRTCServicePath, nil) |
| 339 | waitUntilConnected(t, c1, c2) |
| 340 | |
| 341 | // c1 publishes a track for c2 |
| 342 | writers := publishTracksForClients(t, c1) |
| 343 | defer stopWriters(writers...) |
| 344 | |
| 345 | testutils.WithTimeout(t, func() string { |
| 346 | if len(c2.SubscribedTracks()[c1.ID()]) != 2 { |
| 347 | return "c2 did not receive c1's tracks" |
| 348 | } |
| 349 | return "" |
| 350 | }) |
| 351 | |
| 352 | // revoke permission |
| 353 | ctx := contextWithToken(adminRoomToken(testRoom)) |
| 354 | _, err := roomClient.UpdateParticipant(ctx, &livekit.UpdateParticipantRequest{ |
| 355 | Room: testRoom, |
| 356 | Identity: "c1", |
| 357 | Permission: &livekit.ParticipantPermission{ |
| 358 | CanPublish: false, |
| 359 | CanPublishData: true, |
| 360 | CanSubscribe: true, |
| 361 | }, |
| 362 | }) |
| 363 | require.NoError(t, err) |
| 364 | |
| 365 | // ensure c1 no longer has track published, c2 no longer see track under C1 |
| 366 | testutils.WithTimeout(t, func() string { |
| 367 | if len(c1.GetPublishedTrackIDs()) != 0 { |
| 368 | return "c1 did not unpublish tracks" |
| 369 | } |
| 370 | remoteC1 := c2.GetRemoteParticipant(c1.ID()) |
| 371 | if remoteC1 == nil { |
| 372 | return "c2 doesn't know about c1" |
| 373 | } |
| 374 | if len(remoteC1.Tracks) != 0 { |
| 375 | return "c2 still has c1's tracks" |
| 376 | } |
| 377 | return "" |
| 378 | }) |
| 379 | }) |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | func TestCloseDisconnectedParticipantOnSignalClose(t *testing.T) { |
| 384 | _, _, finish := setupMultiNodeTest("TestCloseDisconnectedParticipantOnSignalClose") |
nothing calls this directly
no test coverage detected