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 {
// ---------------------------------------------------------------------------
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 })
})
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 ])
}
})
+ 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)
})
{
- 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
}
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)
await server.kill()
const config = ObjectStorageCommand.getDefaultScalewayConfig({
- serverNumber: server.internalServerNumber,
+ serverNumber: 1,
enablePrivateProxy: false,
privateACL: 'public-read'
})
}
for (const v of data) {
- await server.servers.waitUntilLog('Removed files of video ' + v.url, 1, true)
+ await server.servers.waitUntilLog('Removed files of video ' + v.url)
}
await cleanupTests([ server ])