X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive.ts;h=d555cff194ff89c533fbf077c6e5e136de41fbda;hb=421ff4618da64f0849353383f690a014024c40da;hp=4676a840a5c1d5ee7ead6ace4db530bd7b29c104;hpb=4c7e60bc17ee5830399bac4aa273356903421b4c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index 4676a840a..d555cff19 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -2,10 +2,10 @@ import 'mocha' import * as chai from 'chai' -import { join } from 'path' +import { basename, join } from 'path' import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils' import { - checkLiveCleanup, + checkLiveCleanupAfterSave, checkLiveSegmentHash, checkResolutionsInMasterPlaylist, cleanupTests, @@ -506,6 +506,10 @@ describe('Test live', function () { await makeRawRequest(hlsPlaylist.playlistUrl, HttpStatusCode.OK_200) await makeRawRequest(hlsPlaylist.segmentsSha256Url, HttpStatusCode.OK_200) + // We should have generated random filenames + expect(basename(hlsPlaylist.playlistUrl)).to.not.equal('master.m3u8') + expect(basename(hlsPlaylist.segmentsSha256Url)).to.not.equal('segments-sha256.json') + expect(hlsPlaylist.files).to.have.lengthOf(resolutions.length) for (const resolution of resolutions) { @@ -520,7 +524,9 @@ describe('Test live', function () { expect(file.fps).to.be.approximately(30, 2) } - const filename = `${video.uuid}-${resolution}-fragmented.mp4` + const filename = basename(file.fileUrl) + expect(filename).to.not.contain(video.uuid) + const segmentPath = servers[0].servers.buildDirectory(join('streaming-playlists', 'hls', video.uuid, filename)) const probe = await ffprobePromise(segmentPath) @@ -537,7 +543,7 @@ describe('Test live', function () { it('Should correctly have cleaned up the live files', async function () { this.timeout(30000) - await checkLiveCleanup(servers[0], liveVideoId, [ 240, 360, 720 ]) + await checkLiveCleanupAfterSave(servers[0], liveVideoId, [ 240, 360, 720 ]) }) })