+ expect(session.error).to.not.exist
+
+ expect(session.replayVideo).to.exist
+ expect(session.replayVideo.id).to.exist
+ expect(session.replayVideo.shortUUID).to.exist
+ expect(session.replayVideo.uuid).to.equal(lastReplayUUID)
+ }
+ })
+
+ it('Should have the first live replay with correct settings', async function () {
+ await checkVideosExist(lastReplayUUID, true, HttpStatusCode.OK_200)
+ await checkVideoState(lastReplayUUID, VideoState.PUBLISHED)
+ await checkVideoPrivacy(lastReplayUUID, VideoPrivacy.PUBLIC)
+ })
+
+ it('Should have cleaned up the live files', async function () {
+ await checkLiveCleanup({ server: servers[0], videoUUID: liveVideoUUID, permanent: false })
+ })
+
+ it('Should correctly terminate the stream on blacklist and blacklist the saved replay video', async function () {
+ this.timeout(120000)
+
+ await servers[0].videos.remove({ id: lastReplayUUID })
+ const { liveDetails } = await publishLiveAndBlacklist({
+ permanent: true,
+ replay: true,
+ replaySettings: { privacy: VideoPrivacy.PUBLIC }
+ })
+
+ const replay = await findExternalSavedVideo(servers[0], liveDetails)
+ expect(replay).to.exist
+
+ for (const videoId of [ liveVideoUUID, replay.uuid ]) {
+ await checkVideosExist(videoId, false)
+
+ await servers[0].videos.get({ id: videoId, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ await servers[1].videos.get({ id: videoId, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ }
+
+ await checkLiveCleanup({ server: servers[0], videoUUID: liveVideoUUID, permanent: false })
+ })
+
+ it('Should correctly terminate the stream on delete and not save the video', async function () {
+ this.timeout(60000)
+
+ const { liveDetails } = await publishLiveAndDelete({
+ permanent: true,
+ replay: true,
+ replaySettings: { privacy: VideoPrivacy.PUBLIC }
+ })
+
+ const replay = await findExternalSavedVideo(servers[0], liveDetails)
+ expect(replay).to.not.exist
+
+ await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404)
+ await checkLiveCleanup({ server: servers[0], videoUUID: liveVideoUUID, permanent: false })
+ })