diff options
Diffstat (limited to 'server/tests/api/object-storage')
-rw-r--r-- | server/tests/api/object-storage/video-static-file-privacy.ts | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/server/tests/api/object-storage/video-static-file-privacy.ts b/server/tests/api/object-storage/video-static-file-privacy.ts index 62edd10ba..71ad35a43 100644 --- a/server/tests/api/object-storage/video-static-file-privacy.ts +++ b/server/tests/api/object-storage/video-static-file-privacy.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import { basename } from 'path' | 4 | import { basename } from 'path' |
5 | import { expectStartWith } from '@server/tests/shared' | 5 | import { checkVideoFileTokenReinjection, expectStartWith } from '@server/tests/shared' |
6 | import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils' | 6 | import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils' |
7 | import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models' | 7 | import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models' |
8 | import { | 8 | import { |
@@ -191,6 +191,20 @@ describe('Object storage for video static file privacy', function () { | |||
191 | } | 191 | } |
192 | }) | 192 | }) |
193 | 193 | ||
194 | it('Should reinject video file token', async function () { | ||
195 | this.timeout(120000) | ||
196 | |||
197 | const videoFileToken = await server.videoToken.getVideoFileToken({ videoId: privateVideoUUID }) | ||
198 | |||
199 | await checkVideoFileTokenReinjection({ | ||
200 | server, | ||
201 | videoUUID: privateVideoUUID, | ||
202 | videoFileToken, | ||
203 | resolutions: [ 240, 720 ], | ||
204 | isLive: false | ||
205 | }) | ||
206 | }) | ||
207 | |||
194 | it('Should update public video to private', async function () { | 208 | it('Should update public video to private', async function () { |
195 | this.timeout(60000) | 209 | this.timeout(60000) |
196 | 210 | ||
@@ -315,6 +329,26 @@ describe('Object storage for video static file privacy', function () { | |||
315 | await checkLiveFiles(permanentLive, permanentLiveId) | 329 | await checkLiveFiles(permanentLive, permanentLiveId) |
316 | }) | 330 | }) |
317 | 331 | ||
332 | it('Should reinject video file token in permanent live', async function () { | ||
333 | this.timeout(240000) | ||
334 | |||
335 | const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: permanentLive.rtmpUrl, streamKey: permanentLive.streamKey }) | ||
336 | await server.live.waitUntilPublished({ videoId: permanentLiveId }) | ||
337 | |||
338 | const video = await server.videos.getWithToken({ id: permanentLiveId }) | ||
339 | const videoFileToken = await server.videoToken.getVideoFileToken({ videoId: video.uuid }) | ||
340 | |||
341 | await checkVideoFileTokenReinjection({ | ||
342 | server, | ||
343 | videoUUID: permanentLiveId, | ||
344 | videoFileToken, | ||
345 | resolutions: [ 720 ], | ||
346 | isLive: true | ||
347 | }) | ||
348 | |||
349 | await stopFfmpeg(ffmpegCommand) | ||
350 | }) | ||
351 | |||
318 | it('Should have created a replay of the normal live with a private static path', async function () { | 352 | it('Should have created a replay of the normal live with a private static path', async function () { |
319 | this.timeout(240000) | 353 | this.timeout(240000) |
320 | 354 | ||