aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/redundancy
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-04 17:08:55 +0100
committerChocobozzz <me@florianbigard.com>2018-12-04 17:08:55 +0100
commitb9fffa297f49a84df8ffd0d7b842599bc88a8e3e (patch)
tree49a12ebebf4d533e8b273abbb9492350a233101d /server/tests/api/redundancy
parent6040f87d143a5fa01db79867ece8197c3ce7be47 (diff)
downloadPeerTube-b9fffa297f49a84df8ffd0d7b842599bc88a8e3e.tar.gz
PeerTube-b9fffa297f49a84df8ffd0d7b842599bc88a8e3e.tar.zst
PeerTube-b9fffa297f49a84df8ffd0d7b842599bc88a8e3e.zip
Create redundancy endpoint
Diffstat (limited to 'server/tests/api/redundancy')
-rw-r--r--server/tests/api/redundancy/redundancy.ts27
1 files changed, 15 insertions, 12 deletions
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
136 if (!videoUUID) videoUUID = video1Server2UUID 136 if (!videoUUID) videoUUID = video1Server2UUID
137 137
138 const webseeds = [ 138 const webseeds = [
139 'http://localhost:9001/static/webseed/' + videoUUID, 139 'http://localhost:9001/static/redundancy/' + videoUUID,
140 'http://localhost:9002/static/webseed/' + videoUUID 140 'http://localhost:9002/static/webseed/' + videoUUID
141 ] 141 ]
142 142
@@ -148,20 +148,23 @@ async function check2Webseeds (strategy: VideoRedundancyStrategy, videoUUID?: st
148 for (const file of video.files) { 148 for (const file of video.files) {
149 checkMagnetWebseeds(file, webseeds, server) 149 checkMagnetWebseeds(file, webseeds, server)
150 150
151 // Only servers 1 and 2 have the video 151 await makeGetRequest({
152 if (server.serverNumber !== 3) { 152 url: servers[0].url,
153 await makeGetRequest({ 153 statusCodeExpected: 200,
154 url: server.url, 154 path: '/static/redundancy/' + `${videoUUID}-${file.resolution.id}.mp4`,
155 statusCodeExpected: 200, 155 contentType: null
156 path: '/static/webseed/' + `${videoUUID}-${file.resolution.id}.mp4`, 156 })
157 contentType: null 157 await makeGetRequest({
158 }) 158 url: servers[1].url,
159 } 159 statusCodeExpected: 200,
160 path: '/static/webseed/' + `${videoUUID}-${file.resolution.id}.mp4`,
161 contentType: null
162 })
160 } 163 }
161 } 164 }
162 165
163 for (const directory of [ 'test1', 'test2' ]) { 166 for (const directory of [ 'test1/redundancy', 'test2/videos' ]) {
164 const files = await readdir(join(root(), directory, 'videos')) 167 const files = await readdir(join(root(), directory))
165 expect(files).to.have.length.at.least(4) 168 expect(files).to.have.length.at.least(4)
166 169
167 for (const resolution of [ 240, 360, 480, 720 ]) { 170 for (const resolution of [ 240, 360, 480, 720 ]) {