]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix redundancy tests
authorChocobozzz <me@florianbigard.com>
Wed, 26 Sep 2018 08:16:12 +0000 (10:16 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 26 Sep 2018 08:16:12 +0000 (10:16 +0200)
server/tests/api/server/redundancy.ts

index f4ae4c06532653f875d72799bf5038860510c703..9b3b1b4ad5fdf78465c7aac06ca074cda93de806 100644 (file)
@@ -143,19 +143,20 @@ 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
+          })
+        }
       }
     }
   }
 
-  for (const url of [ 'http://localhost:9001', 'http://localhost:9002' ]) {
-    await makeGetRequest({
-      url,
-      statusCodeExpected: 200,
-      path: '/static/webseed/' + videoUUID,
-      contentType: null
-    })
-  }
-
   for (const directory of [ 'test1', 'test2' ]) {
     const files = await readdir(join(root(), directory, 'videos'))
     expect(files).to.have.length.at.least(4)