X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fobject-storage%2Fvideo-static-file-privacy.ts;h=930c88543ba680a1e26273be084d226732e16103;hb=05a60d85997c108d39bcfb14f1ffd4c74f8b1e93;hp=62edd10ba056eea3b5afd6cf4b96bba349f597a7;hpb=e8299615c198c3d814123f823761f78f61a6c599;p=github%2FChocobozzz%2FPeerTube.git 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..930c88543 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 @@ import { expect } from 'chai' import { basename } from 'path' -import { expectStartWith } from '@server/tests/shared' +import { checkVideoFileTokenReinjection, expectStartWith } from '@server/tests/shared' import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils' import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models' import { @@ -120,7 +120,7 @@ describe('Object storage for video static file privacy', function () { // --------------------------------------------------------------------------- it('Should upload a private video and have appropriate object storage ACL', async function () { - this.timeout(60000) + this.timeout(120000) { const { uuid } = await server.videos.quickUpload({ name: 'video', privacy: VideoPrivacy.PRIVATE }) @@ -138,7 +138,7 @@ describe('Object storage for video static file privacy', function () { }) it('Should upload a public video and have appropriate object storage ACL', async function () { - this.timeout(60000) + this.timeout(120000) const { uuid } = await server.videos.quickUpload({ name: 'video', privacy: VideoPrivacy.UNLISTED }) await waitJobs([ server ]) @@ -191,6 +191,20 @@ describe('Object storage for video static file privacy', function () { } }) + it('Should reinject video file token', async function () { + this.timeout(120000) + + const videoFileToken = await server.videoToken.getVideoFileToken({ videoId: privateVideoUUID }) + + await checkVideoFileTokenReinjection({ + server, + videoUUID: privateVideoUUID, + videoFileToken, + resolutions: [ 240, 720 ], + isLive: false + }) + }) + it('Should update public video to private', async function () { this.timeout(60000) @@ -291,13 +305,21 @@ describe('Object storage for video static file privacy', function () { }) { - const { video, live } = await server.live.quickCreate({ saveReplay: true, permanentLive: false, privacy: VideoPrivacy.PRIVATE }) + const { video, live } = await server.live.quickCreate({ + saveReplay: true, + permanentLive: false, + privacy: VideoPrivacy.PRIVATE + }) normalLiveId = video.uuid normalLive = live } { - const { video, live } = await server.live.quickCreate({ saveReplay: true, permanentLive: true, privacy: VideoPrivacy.PRIVATE }) + const { video, live } = await server.live.quickCreate({ + saveReplay: true, + permanentLive: true, + privacy: VideoPrivacy.PRIVATE + }) permanentLiveId = video.uuid permanentLive = live } @@ -315,6 +337,26 @@ describe('Object storage for video static file privacy', function () { await checkLiveFiles(permanentLive, permanentLiveId) }) + it('Should reinject video file token in permanent live', async function () { + this.timeout(240000) + + const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: permanentLive.rtmpUrl, streamKey: permanentLive.streamKey }) + await server.live.waitUntilPublished({ videoId: permanentLiveId }) + + const video = await server.videos.getWithToken({ id: permanentLiveId }) + const videoFileToken = await server.videoToken.getVideoFileToken({ videoId: video.uuid }) + + await checkVideoFileTokenReinjection({ + server, + videoUUID: permanentLiveId, + videoFileToken, + resolutions: [ 720 ], + isLive: true + }) + + await stopFfmpeg(ffmpegCommand) + }) + it('Should have created a replay of the normal live with a private static path', async function () { this.timeout(240000)