+ let videoAudioUUID = ''
+
+ function runTestSuite (hlsOnly: boolean, objectStorageBaseUrl?: string) {
+
+ it('Should upload a video and transcode it to HLS', async function () {
+ this.timeout(120000)
+
+ const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video 1', fixture: 'video_short.webm' } })
+ videoUUID = uuid
+
+ await waitJobs(servers)
+
+ await checkHlsPlaylist({ servers, videoUUID, hlsOnly, objectStorageBaseUrl })
+ })
+
+ it('Should upload an audio file and transcode it to HLS', async function () {
+ this.timeout(120000)
+
+ const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video audio', fixture: 'sample.ogg' } })
+ videoAudioUUID = uuid
+
+ await waitJobs(servers)
+
+ await checkHlsPlaylist({
+ servers,
+ videoUUID: videoAudioUUID,
+ hlsOnly,
+ resolutions: [ DEFAULT_AUDIO_RESOLUTION, 360, 240 ],
+ objectStorageBaseUrl
+ })
+ })
+
+ it('Should update the video', async function () {
+ this.timeout(30000)
+
+ await servers[0].videos.update({ id: videoUUID, attributes: { name: 'video 1 updated' } })
+
+ await waitJobs(servers)
+
+ await checkHlsPlaylist({ servers, videoUUID, hlsOnly, objectStorageBaseUrl })
+ })
+
+ it('Should delete videos', async function () {
+ this.timeout(10000)
+
+ await servers[0].videos.remove({ id: videoUUID })
+ await servers[0].videos.remove({ id: videoAudioUUID })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ await server.videos.get({ id: videoUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await server.videos.get({ id: videoAudioUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ }
+ })
+
+ it('Should have the playlists/segment deleted from the disk', async function () {
+ for (const server of servers) {
+ await checkDirectoryIsEmpty(server, 'videos')
+ await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls'))
+ }
+ })
+
+ it('Should have an empty tmp directory', async function () {
+ for (const server of servers) {
+ await checkTmpIsEmpty(server)
+ }
+ })
+ }