+ function runTestSuite (hlsOnly: boolean) {
+ it('Should upload a video and transcode it to HLS', async function () {
+ this.timeout(120000)
+
+ const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video 1', fixture: 'video_short.webm' })
+ videoUUID = res.body.video.uuid
+
+ await waitJobs(servers)
+
+ await checkHlsPlaylist(servers, videoUUID, hlsOnly)
+ })
+
+ it('Should upload an audio file and transcode it to HLS', async function () {
+ this.timeout(120000)
+
+ const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video audio', fixture: 'sample.ogg' })
+ videoAudioUUID = res.body.video.uuid
+
+ await waitJobs(servers)
+
+ await checkHlsPlaylist(servers, videoAudioUUID, hlsOnly, [ DEFAULT_AUDIO_RESOLUTION ])
+ })
+
+ it('Should update the video', async function () {
+ this.timeout(10000)
+
+ await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, { name: 'video 1 updated' })
+
+ await waitJobs(servers)
+
+ await checkHlsPlaylist(servers, videoUUID, hlsOnly)
+ })
+
+ it('Should delete videos', async function () {
+ this.timeout(10000)
+
+ await removeVideo(servers[0].url, servers[0].accessToken, videoUUID)
+ await removeVideo(servers[0].url, servers[0].accessToken, videoAudioUUID)
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ await getVideo(server.url, videoUUID, 404)
+ await getVideo(server.url, videoAudioUUID, 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)
+ }
+ })
+ }
+