From b9fffa297f49a84df8ffd0d7b842599bc88a8e3e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 17:08:55 +0100 Subject: Create redundancy endpoint --- server/tests/api/redundancy/redundancy.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'server/tests/api/redundancy/redundancy.ts') diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index a8a2f305f..5b29a503a 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts @@ -136,7 +136,7 @@ async function check2Webseeds (strategy: VideoRedundancyStrategy, videoUUID?: st if (!videoUUID) videoUUID = video1Server2UUID const webseeds = [ - 'http://localhost:9001/static/webseed/' + videoUUID, + 'http://localhost:9001/static/redundancy/' + videoUUID, 'http://localhost:9002/static/webseed/' + videoUUID ] @@ -148,20 +148,23 @@ async function check2Webseeds (strategy: VideoRedundancyStrategy, videoUUID?: st for (const file of video.files) { checkMagnetWebseeds(file, webseeds, server) - // Only servers 1 and 2 have the video - if (server.serverNumber !== 3) { - await makeGetRequest({ - url: server.url, - statusCodeExpected: 200, - path: '/static/webseed/' + `${videoUUID}-${file.resolution.id}.mp4`, - contentType: null - }) - } + await makeGetRequest({ + url: servers[0].url, + statusCodeExpected: 200, + path: '/static/redundancy/' + `${videoUUID}-${file.resolution.id}.mp4`, + contentType: null + }) + await makeGetRequest({ + url: servers[1].url, + statusCodeExpected: 200, + path: '/static/webseed/' + `${videoUUID}-${file.resolution.id}.mp4`, + contentType: null + }) } } - for (const directory of [ 'test1', 'test2' ]) { - const files = await readdir(join(root(), directory, 'videos')) + for (const directory of [ 'test1/redundancy', 'test2/videos' ]) { + const files = await readdir(join(root(), directory)) expect(files).to.have.length.at.least(4) for (const resolution of [ 240, 360, 480, 720 ]) { -- cgit v1.2.3