]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/multiple-pods.js
1 /* eslint-disable no-unused-expressions */
5 const chai
= require('chai')
6 const each
= require('async/each')
7 const eachSeries
= require('async/eachSeries')
8 const expect
= chai
.expect
9 const parallel
= require('async/parallel')
10 const series
= require('async/series')
11 const WebTorrent
= require('webtorrent')
12 const webtorrent
= new WebTorrent()
14 const loginUtils
= require('../utils/login')
15 const miscsUtils
= require('../utils/miscs')
16 const podsUtils
= require('../utils/pods')
17 const serversUtils
= require('../utils/servers')
18 const videosUtils
= require('../utils/videos')
20 describe('Test multiple pods', function () {
25 before(function (done
) {
31 serversUtils
.flushAndRunMultipleServers(3, function (serversRun
) {
36 // Get the access tokens
38 each(servers
, function (server
, callbackEach
) {
39 loginUtils
.loginAndGetAccessToken(server
, function (err
, accessToken
) {
40 if (err
) return callbackEach(err
)
42 server
.accessToken
= accessToken
47 // The second pod make friend with the third
49 const server
= servers
[1]
50 podsUtils
.makeFriends(server
.url
, server
.accessToken
, next
)
52 // Wait for the request between pods
54 setTimeout(next
, 10000)
56 // Pod 1 make friends too
58 const server
= servers
[0]
59 podsUtils
.makeFriends(server
.url
, server
.accessToken
, next
)
64 it('Should not have videos for all pods', function (done
) {
65 each(servers
, function (server
, callback
) {
66 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
69 const videos
= res
.body
.data
70 expect(videos
).to
.be
.an('array')
71 expect(videos
.length
).to
.equal(0)
78 describe('Should upload the video and propagate on each pod', function () {
79 it('Should upload the video on pod 1 and propagate on each pod', function (done
) {
80 // Pod 1 has video transcoding activated
85 const videoAttributes
= {
86 name: 'my super name for pod 1',
91 description: 'my super description for pod 1',
92 tags: [ 'tag1p1', 'tag2p1' ],
93 fixture: 'video_short1.webm'
95 videosUtils
.uploadVideo(servers
[0].url
, servers
[0].accessToken
, videoAttributes
, next
)
98 setTimeout(next
, 11000)
100 // All pods should have this video
104 each(servers
, function (server
, callback
) {
105 let baseMagnet
= null
107 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
110 const videos
= res
.body
.data
111 expect(videos
).to
.be
.an('array')
112 expect(videos
.length
).to
.equal(1)
113 const video
= videos
[0]
114 expect(video
.name
).to
.equal('my super name for pod 1')
115 expect(video
.category
).to
.equal(5)
116 expect(video
.categoryLabel
).to
.equal('Sports')
117 expect(video
.licence
).to
.equal(4)
118 expect(video
.licenceLabel
).to
.equal('Attribution - Non Commercial')
119 expect(video
.language
).to
.equal(9)
120 expect(video
.languageLabel
).to
.equal('Japanese')
121 expect(video
.nsfw
).to
.be
.ok
122 expect(video
.description
).to
.equal('my super description for pod 1')
123 expect(video
.podHost
).to
.equal('localhost:9001')
124 expect(video
.duration
).to
.equal(10)
125 expect(video
.tags
).to
.deep
.equal([ 'tag1p1', 'tag2p1' ])
126 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
127 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
128 expect(video
.author
).to
.equal('root')
130 expect(video
.files
).to
.have
.lengthOf(1)
132 const file
= video
.files
[0]
133 const magnetUri
= file
.magnetUri
134 expect(file
.magnetUri
).to
.exist
135 expect(file
.resolution
).to
.equal(0)
136 expect(file
.resolutionLabel
).to
.equal('original')
137 expect(file
.size
).to
.equal(572456)
139 if (server
.url
!== 'http://localhost:9001') {
140 expect(video
.isLocal
).to
.be
.false
142 expect(video
.isLocal
).to
.be
.true
145 // All pods should have the same magnet Uri
146 if (baseMagnet
=== null) {
147 baseMagnet
= magnetUri
149 expect(baseMagnet
).to
.equal(magnetUri
)
152 videosUtils
.testVideoImage(server
.url
, 'video_short1.webm', video
.thumbnailPath
, function (err
, test
) {
154 expect(test
).to
.equal(true)
164 it('Should upload the video on pod 2 and propagate on each pod', function (done
) {
169 const videoAttributes
= {
170 name: 'my super name for pod 2',
175 description: 'my super description for pod 2',
176 tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ],
177 fixture: 'video_short2.webm'
179 videosUtils
.uploadVideo(servers
[1].url
, servers
[1].accessToken
, videoAttributes
, next
)
182 // Transcoding, so wait more that 22 seconds
183 setTimeout(next
, 42000)
185 // All pods should have this video
189 each(servers
, function (server
, callback
) {
190 let baseMagnet
= null
192 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
195 const videos
= res
.body
.data
196 expect(videos
).to
.be
.an('array')
197 expect(videos
.length
).to
.equal(2)
198 const video
= videos
[1]
199 expect(video
.name
).to
.equal('my super name for pod 2')
200 expect(video
.category
).to
.equal(4)
201 expect(video
.categoryLabel
).to
.equal('Art')
202 expect(video
.licence
).to
.equal(3)
203 expect(video
.licenceLabel
).to
.equal('Attribution - No Derivatives')
204 expect(video
.language
).to
.equal(11)
205 expect(video
.languageLabel
).to
.equal('German')
206 expect(video
.nsfw
).to
.be
.true
207 expect(video
.description
).to
.equal('my super description for pod 2')
208 expect(video
.podHost
).to
.equal('localhost:9002')
209 expect(video
.duration
).to
.equal(5)
210 expect(video
.tags
).to
.deep
.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
211 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
212 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
213 expect(video
.author
).to
.equal('root')
215 expect(video
.files
).to
.have
.lengthOf(1)
217 const file
= video
.files
[0]
218 const magnetUri
= file
.magnetUri
219 expect(file
.magnetUri
).to
.exist
220 expect(file
.resolution
).to
.equal(0)
221 expect(file
.resolutionLabel
).to
.equal('original')
222 expect(file
.size
).to
.equal(942961)
224 if (server
.url
!== 'http://localhost:9002') {
225 expect(video
.isLocal
).to
.be
.false
227 expect(video
.isLocal
).to
.be
.true
230 // All pods should have the same magnet Uri
231 if (baseMagnet
=== null) {
232 baseMagnet
= magnetUri
234 expect(baseMagnet
).to
.equal(magnetUri
)
237 videosUtils
.testVideoImage(server
.url
, 'video_short2.webm', video
.thumbnailPath
, function (err
, test
) {
239 expect(test
).to
.equal(true)
249 it('Should upload two videos on pod 3 and propagate on each pod', function (done
) {
254 const videoAttributes
= {
255 name: 'my super name for pod 3',
260 description: 'my super description for pod 3',
262 fixture: 'video_short3.webm'
264 videosUtils
.uploadVideo(servers
[2].url
, servers
[2].accessToken
, videoAttributes
, next
)
267 const videoAttributes
= {
268 name: 'my super name for pod 3-2',
273 description: 'my super description for pod 3-2',
274 tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ],
275 fixture: 'video_short.webm'
277 videosUtils
.uploadVideo(servers
[2].url
, servers
[2].accessToken
, videoAttributes
, next
)
280 setTimeout(next
, 33000)
285 let baseMagnet
= null
286 // All pods should have this video
287 each(servers
, function (server
, callback
) {
288 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
291 const videos
= res
.body
.data
292 expect(videos
).to
.be
.an('array')
293 expect(videos
.length
).to
.equal(4)
295 // We not sure about the order of the two last uploads
298 if (videos
[2].name
=== 'my super name for pod 3') {
306 expect(video1
.name
).to
.equal('my super name for pod 3')
307 expect(video1
.category
).to
.equal(6)
308 expect(video1
.categoryLabel
).to
.equal('Travels')
309 expect(video1
.licence
).to
.equal(5)
310 expect(video1
.licenceLabel
).to
.equal('Attribution - Non Commercial - Share Alike')
311 expect(video1
.language
).to
.equal(11)
312 expect(video1
.languageLabel
).to
.equal('German')
313 expect(video1
.nsfw
).to
.be
.ok
314 expect(video1
.description
).to
.equal('my super description for pod 3')
315 expect(video1
.podHost
).to
.equal('localhost:9003')
316 expect(video1
.duration
).to
.equal(5)
317 expect(video1
.tags
).to
.deep
.equal([ 'tag1p3' ])
318 expect(video1
.author
).to
.equal('root')
319 expect(miscsUtils
.dateIsValid(video1
.createdAt
)).to
.be
.true
320 expect(miscsUtils
.dateIsValid(video1
.updatedAt
)).to
.be
.true
322 expect(video1
.files
).to
.have
.lengthOf(1)
324 const file1
= video1
.files
[0]
325 const magnetUri1
= file1
.magnetUri
326 expect(file1
.magnetUri
).to
.exist
327 expect(file1
.resolution
).to
.equal(0)
328 expect(file1
.resolutionLabel
).to
.equal('original')
329 expect(file1
.size
).to
.equal(292677)
331 expect(video2
.name
).to
.equal('my super name for pod 3-2')
332 expect(video2
.category
).to
.equal(7)
333 expect(video2
.categoryLabel
).to
.equal('Gaming')
334 expect(video2
.licence
).to
.equal(6)
335 expect(video2
.licenceLabel
).to
.equal('Attribution - Non Commercial - No Derivatives')
336 expect(video2
.language
).to
.equal(12)
337 expect(video2
.languageLabel
).to
.equal('Korean')
338 expect(video2
.nsfw
).to
.be
.false
339 expect(video2
.description
).to
.equal('my super description for pod 3-2')
340 expect(video2
.podHost
).to
.equal('localhost:9003')
341 expect(video2
.duration
).to
.equal(5)
342 expect(video2
.tags
).to
.deep
.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
343 expect(video2
.author
).to
.equal('root')
344 expect(miscsUtils
.dateIsValid(video2
.createdAt
)).to
.be
.true
345 expect(miscsUtils
.dateIsValid(video2
.updatedAt
)).to
.be
.true
347 expect(video2
.files
).to
.have
.lengthOf(1)
349 const file2
= video2
.files
[0]
350 const magnetUri2
= file2
.magnetUri
351 expect(file2
.magnetUri
).to
.exist
352 expect(file2
.resolution
).to
.equal(0)
353 expect(file2
.resolutionLabel
).to
.equal('original')
354 expect(file2
.size
).to
.equal(218910)
356 if (server
.url
!== 'http://localhost:9003') {
357 expect(video1
.isLocal
).to
.be
.false
358 expect(video2
.isLocal
).to
.be
.false
360 expect(video1
.isLocal
).to
.be
.true
361 expect(video2
.isLocal
).to
.be
.true
364 // All pods should have the same magnet Uri
365 if (baseMagnet
=== null) {
366 baseMagnet
= magnetUri2
368 expect(baseMagnet
).to
.equal(magnetUri2
)
371 videosUtils
.testVideoImage(server
.url
, 'video_short3.webm', video1
.thumbnailPath
, function (err
, test
) {
373 expect(test
).to
.equal(true)
375 videosUtils
.testVideoImage(server
.url
, 'video_short.webm', video2
.thumbnailPath
, function (err
, test
) {
377 expect(test
).to
.equal(true)
389 describe('Should seed the uploaded video', function () {
390 it('Should add the file 1 by asking pod 3', function (done
) {
391 // Yes, this could be long
394 videosUtils
.getVideosList(servers
[2].url
, function (err
, res
) {
397 const video
= res
.body
.data
[0]
398 toRemove
.push(res
.body
.data
[2])
399 toRemove
.push(res
.body
.data
[3])
401 webtorrent
.add(video
.files
[0].magnetUri
, function (torrent
) {
402 expect(torrent
.files
).to
.exist
403 expect(torrent
.files
.length
).to
.equal(1)
404 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
411 it('Should add the file 2 by asking pod 1', function (done
) {
412 // Yes, this could be long
415 videosUtils
.getVideosList(servers
[0].url
, function (err
, res
) {
418 const video
= res
.body
.data
[1]
420 webtorrent
.add(video
.files
[0].magnetUri
, function (torrent
) {
421 expect(torrent
.files
).to
.exist
422 expect(torrent
.files
.length
).to
.equal(1)
423 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
430 it('Should add the file 3 by asking pod 2', function (done
) {
431 // Yes, this could be long
434 videosUtils
.getVideosList(servers
[1].url
, function (err
, res
) {
437 const video
= res
.body
.data
[2]
439 webtorrent
.add(video
.files
[0].magnetUri
, function (torrent
) {
440 expect(torrent
.files
).to
.exist
441 expect(torrent
.files
.length
).to
.equal(1)
442 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
449 it('Should add the file 3-2 by asking pod 1', function (done
) {
450 // Yes, this could be long
453 videosUtils
.getVideosList(servers
[0].url
, function (err
, res
) {
456 const video
= res
.body
.data
[3]
458 webtorrent
.add(video
.files
[0].magnetUri
, function (torrent
) {
459 expect(torrent
.files
).to
.exist
460 expect(torrent
.files
.length
).to
.equal(1)
461 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
469 describe('Should update video views, likes and dislikes', function () {
470 let localVideosPod3
= []
471 let remoteVideosPod1
= []
472 let remoteVideosPod2
= []
473 let remoteVideosPod3
= []
475 before(function (done
) {
477 function (callback
) {
478 videosUtils
.getVideosList(servers
[0].url
, function (err
, res
) {
481 remoteVideosPod1
= res
.body
.data
.filter(video
=> video
.isLocal
=== false).map(video
=> video
.id
)
487 function (callback
) {
488 videosUtils
.getVideosList(servers
[1].url
, function (err
, res
) {
491 remoteVideosPod2
= res
.body
.data
.filter(video
=> video
.isLocal
=== false).map(video
=> video
.id
)
497 function (callback
) {
498 videosUtils
.getVideosList(servers
[2].url
, function (err
, res
) {
501 localVideosPod3
= res
.body
.data
.filter(video
=> video
.isLocal
=== true).map(video
=> video
.id
)
502 remoteVideosPod3
= res
.body
.data
.filter(video
=> video
.isLocal
=== false).map(video
=> video
.id
)
510 it('Should view multiple videos on owned servers', function (done
) {
514 function (callback
) {
515 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[0], callback
)
518 function (callback
) {
519 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[0], callback
)
522 function (callback
) {
523 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[0], callback
)
526 function (callback
) {
527 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[1], callback
)
530 function (callback
) {
531 setTimeout(callback
, 22000)
536 eachSeries(servers
, function (server
, callback
) {
537 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
540 const videos
= res
.body
.data
541 expect(videos
.find(video
=> video
.views
=== 3)).to
.exist
542 expect(videos
.find(video
=> video
.views
=== 1)).to
.exist
550 it('Should view multiple videos on each servers', function (done
) {
554 function (callback
) {
555 videosUtils
.getVideo(servers
[0].url
, remoteVideosPod1
[0], callback
)
558 function (callback
) {
559 videosUtils
.getVideo(servers
[1].url
, remoteVideosPod2
[0], callback
)
562 function (callback
) {
563 videosUtils
.getVideo(servers
[1].url
, remoteVideosPod2
[0], callback
)
566 function (callback
) {
567 videosUtils
.getVideo(servers
[2].url
, remoteVideosPod3
[0], callback
)
570 function (callback
) {
571 videosUtils
.getVideo(servers
[2].url
, remoteVideosPod3
[1], callback
)
574 function (callback
) {
575 videosUtils
.getVideo(servers
[2].url
, remoteVideosPod3
[1], callback
)
578 function (callback
) {
579 videosUtils
.getVideo(servers
[2].url
, remoteVideosPod3
[1], callback
)
582 function (callback
) {
583 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[1], callback
)
586 function (callback
) {
587 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[1], callback
)
590 function (callback
) {
591 videosUtils
.getVideo(servers
[2].url
, localVideosPod3
[1], callback
)
594 function (callback
) {
595 setTimeout(callback
, 22000)
600 let baseVideos
= null
601 eachSeries(servers
, function (server
, callback
) {
602 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
605 const videos
= res
.body
.data
607 // Initialize base videos for future comparisons
608 if (baseVideos
=== null) {
613 baseVideos
.forEach(baseVideo
=> {
614 const sameVideo
= videos
.find(video
=> video
.name
=== baseVideo
.name
)
615 expect(baseVideo
.views
).to
.equal(sameVideo
.views
)
624 it('Should like and dislikes videos on different services', function (done
) {
628 function (callback
) {
629 videosUtils
.rateVideo(servers
[0].url
, servers
[0].accessToken
, remoteVideosPod1
[0], 'like', callback
)
632 function (callback
) {
633 videosUtils
.rateVideo(servers
[0].url
, servers
[0].accessToken
, remoteVideosPod1
[0], 'dislike', callback
)
636 function (callback
) {
637 videosUtils
.rateVideo(servers
[0].url
, servers
[0].accessToken
, remoteVideosPod1
[0], 'like', callback
)
640 function (callback
) {
641 videosUtils
.rateVideo(servers
[2].url
, servers
[2].accessToken
, localVideosPod3
[1], 'like', callback
)
644 function (callback
) {
645 videosUtils
.rateVideo(servers
[2].url
, servers
[2].accessToken
, localVideosPod3
[1], 'dislike', callback
)
648 function (callback
) {
649 videosUtils
.rateVideo(servers
[2].url
, servers
[2].accessToken
, remoteVideosPod3
[1], 'dislike', callback
)
652 function (callback
) {
653 videosUtils
.rateVideo(servers
[2].url
, servers
[2].accessToken
, remoteVideosPod3
[0], 'like', callback
)
656 function (callback
) {
657 setTimeout(callback
, 22000)
662 let baseVideos
= null
663 eachSeries(servers
, function (server
, callback
) {
664 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
667 const videos
= res
.body
.data
669 // Initialize base videos for future comparisons
670 if (baseVideos
=== null) {
675 baseVideos
.forEach(baseVideo
=> {
676 const sameVideo
= videos
.find(video
=> video
.name
=== baseVideo
.name
)
677 expect(baseVideo
.likes
).to
.equal(sameVideo
.likes
)
678 expect(baseVideo
.dislikes
).to
.equal(sameVideo
.dislikes
)
688 describe('Should manipulate these videos', function () {
689 it('Should update the video 3 by asking pod 3', function (done
) {
693 name: 'my super video updated',
698 description: 'my super description updated',
699 tags: [ 'tagup1', 'tagup2' ]
701 videosUtils
.updateVideo(servers
[2].url
, servers
[2].accessToken
, toRemove
[0].id
, attributes
, function (err
) {
704 setTimeout(done
, 11000)
708 it('Should have the video 3 updated on each pod', function (done
) {
711 each(servers
, function (server
, callback
) {
712 // Avoid "duplicate torrent" errors
713 const webtorrent
= new WebTorrent()
715 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
718 const videos
= res
.body
.data
719 const videoUpdated
= videos
.find(function (video
) {
720 return video
.name
=== 'my super video updated'
723 expect(!!videoUpdated
).to
.be
.true
724 expect(videoUpdated
.category
).to
.equal(10)
725 expect(videoUpdated
.categoryLabel
).to
.equal('Entertainment')
726 expect(videoUpdated
.licence
).to
.equal(7)
727 expect(videoUpdated
.licenceLabel
).to
.equal('Public Domain Dedication')
728 expect(videoUpdated
.language
).to
.equal(13)
729 expect(videoUpdated
.languageLabel
).to
.equal('French')
730 expect(videoUpdated
.nsfw
).to
.be
.ok
731 expect(videoUpdated
.description
).to
.equal('my super description updated')
732 expect(videoUpdated
.tags
).to
.deep
.equal([ 'tagup1', 'tagup2' ])
733 expect(miscsUtils
.dateIsValid(videoUpdated
.updatedAt
, 20000)).to
.be
.true
735 const file
= videoUpdated
.files
[0]
736 const magnetUri
= file
.magnetUri
737 expect(file
.magnetUri
).to
.exist
738 expect(file
.resolution
).to
.equal(0)
739 expect(file
.resolutionLabel
).to
.equal('original')
740 expect(file
.size
).to
.equal(292677)
742 videosUtils
.testVideoImage(server
.url
, 'video_short3.webm', videoUpdated
.thumbnailPath
, function (err
, test
) {
744 expect(test
).to
.equal(true)
746 webtorrent
.add(videoUpdated
.files
[0].magnetUri
, function (torrent
) {
747 expect(torrent
.files
).to
.exist
748 expect(torrent
.files
.length
).to
.equal(1)
749 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
758 it('Should remove the videos 3 and 3-2 by asking pod 3', function (done
) {
763 videosUtils
.removeVideo(servers
[2].url
, servers
[2].accessToken
, toRemove
[0].id
, next
)
766 videosUtils
.removeVideo(servers
[2].url
, servers
[2].accessToken
, toRemove
[1].id
, next
)
770 setTimeout(done
, 11000)
775 it('Should have videos 1 and 3 on each pod', function (done
) {
776 each(servers
, function (server
, callback
) {
777 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
780 const videos
= res
.body
.data
781 expect(videos
).to
.be
.an('array')
782 expect(videos
.length
).to
.equal(2)
783 expect(videos
[0].name
).not
.to
.equal(videos
[1].name
)
784 expect(videos
[0].name
).not
.to
.equal(toRemove
[0].name
)
785 expect(videos
[1].name
).not
.to
.equal(toRemove
[0].name
)
786 expect(videos
[0].name
).not
.to
.equal(toRemove
[1].name
)
787 expect(videos
[1].name
).not
.to
.equal(toRemove
[1].name
)
789 videoUUID
= videos
.find(video
=> video
.name
=== 'my super name for pod 1').uuid
796 it('Should get the same video by UUID on each pod', function (done
) {
798 each(servers
, function (server
, callback
) {
799 videosUtils
.getVideo(server
.url
, videoUUID
, function (err
, res
) {
802 const video
= res
.body
804 if (baseVideo
=== null) {
809 expect(baseVideo
.name
).to
.equal(video
.name
)
810 expect(baseVideo
.uuid
).to
.equal(video
.uuid
)
811 expect(baseVideo
.category
).to
.equal(video
.category
)
812 expect(baseVideo
.language
).to
.equal(video
.language
)
813 expect(baseVideo
.licence
).to
.equal(video
.licence
)
814 expect(baseVideo
.category
).to
.equal(video
.category
)
815 expect(baseVideo
.nsfw
).to
.equal(video
.nsfw
)
816 expect(baseVideo
.author
).to
.equal(video
.author
)
817 expect(baseVideo
.tags
).to
.deep
.equal(video
.tags
)
824 it('Should get the preview from each pod', function (done
) {
825 each(servers
, function (server
, callback
) {
826 videosUtils
.getVideo(server
.url
, videoUUID
, function (err
, res
) {
829 const video
= res
.body
831 videosUtils
.testVideoImage(server
.url
, 'video_short1-preview.webm', video
.previewPath
, function (err
, test
) {
833 expect(test
).to
.equal(true)
842 after(function (done
) {
843 servers
.forEach(function (server
) {
844 process
.kill(-server
.app
.pid
)
847 // Keep the logs if the test failed
849 serversUtils
.flushTests(done
)