diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-07 15:08:19 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-02-11 09:13:02 +0100 |
commit | 4c280004ce62bf11ddb091854c28f1e1d54a54d6 (patch) | |
tree | 1899fff4ef18f8663a865997d5d06119b2149319 /server/tests/api/redundancy/redundancy.ts | |
parent | 6ec0b75beb9c8bcd84e178912319913b91830da2 (diff) | |
download | PeerTube-4c280004ce62bf11ddb091854c28f1e1d54a54d6.tar.gz PeerTube-4c280004ce62bf11ddb091854c28f1e1d54a54d6.tar.zst PeerTube-4c280004ce62bf11ddb091854c28f1e1d54a54d6.zip |
Use a single file instead of segments for HLS
Diffstat (limited to 'server/tests/api/redundancy/redundancy.ts')
-rw-r--r-- | server/tests/api/redundancy/redundancy.ts | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 5b99309fb..778611fff 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -17,7 +17,7 @@ import { | |||
17 | viewVideo, | 17 | viewVideo, |
18 | wait, | 18 | wait, |
19 | waitUntilLog, | 19 | waitUntilLog, |
20 | checkVideoFilesWereRemoved, removeVideo, getVideoWithToken, reRunServer | 20 | checkVideoFilesWereRemoved, removeVideo, getVideoWithToken, reRunServer, checkSegmentHash |
21 | } from '../../../../shared/utils' | 21 | } from '../../../../shared/utils' |
22 | import { waitJobs } from '../../../../shared/utils/server/jobs' | 22 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
23 | 23 | ||
@@ -178,20 +178,24 @@ async function check1PlaylistRedundancies (videoUUID?: string) { | |||
178 | expect(redundancy.baseUrl).to.equal(servers[0].url + '/static/redundancy/hls/' + videoUUID) | 178 | expect(redundancy.baseUrl).to.equal(servers[0].url + '/static/redundancy/hls/' + videoUUID) |
179 | } | 179 | } |
180 | 180 | ||
181 | await makeGetRequest({ | 181 | const baseUrlPlaylist = servers[1].url + '/static/playlists/hls' |
182 | url: servers[0].url, | 182 | const baseUrlSegment = servers[0].url + '/static/redundancy/hls' |
183 | statusCodeExpected: 200, | 183 | |
184 | path: `/static/redundancy/hls/${videoUUID}/360_000.ts`, | 184 | const res = await getVideo(servers[0].url, videoUUID) |
185 | contentType: null | 185 | const hlsPlaylist = (res.body as VideoDetails).streamingPlaylists[0] |
186 | }) | 186 | |
187 | for (const resolution of [ 240, 360, 480, 720 ]) { | ||
188 | await checkSegmentHash(baseUrlPlaylist, baseUrlSegment, videoUUID, resolution, hlsPlaylist) | ||
189 | } | ||
187 | 190 | ||
188 | for (const directory of [ 'test1/redundancy/hls', 'test2/playlists/hls' ]) { | 191 | for (const directory of [ 'test1/redundancy/hls', 'test2/playlists/hls' ]) { |
189 | const files = await readdir(join(root(), directory, videoUUID)) | 192 | const files = await readdir(join(root(), directory, videoUUID)) |
190 | expect(files).to.have.length.at.least(4) | 193 | expect(files).to.have.length.at.least(4) |
191 | 194 | ||
192 | for (const resolution of [ 240, 360, 480, 720 ]) { | 195 | for (const resolution of [ 240, 360, 480, 720 ]) { |
193 | expect(files.find(f => f === `${resolution}_000.ts`)).to.not.be.undefined | 196 | const filename = `${videoUUID}-${resolution}-fragmented.mp4` |
194 | expect(files.find(f => f === `${resolution}_001.ts`)).to.not.be.undefined | 197 | |
198 | expect(files.find(f => f === filename)).to.not.be.undefined | ||
195 | } | 199 | } |
196 | } | 200 | } |
197 | } | 201 | } |