// Video is not private anymore, send a create action to remote servers
if (wasPrivateVideo === true && videoInstance.privacy !== VideoPrivacy.PRIVATE) {
await sendAddVideo(videoInstance, t)
+ await shareVideoByServer(videoInstance, t)
}
})
}
await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
- await wait(11000)
+ await wait(5000)
// All servers should have this video
for (const server of servers) {
})
it('Should upload the video on server 2 and propagate on each server', async function () {
- this.timeout(120000)
+ this.timeout(50000)
const user = {
username: 'user1',
}
await uploadVideo(servers[1].url, userAccessToken, videoAttributes)
- // Transcoding, so wait more than 22000
- await wait(60000)
+ // Transcoding
+ await wait(10000)
// All servers should have this video
for (const server of servers) {
}
await uploadVideo(servers[2].url, servers[2].accessToken, videoAttributes2)
- await wait(33000)
+ await wait(10000)
let baseMagnet = null
// All servers should have this video
describe('Should seed the uploaded video', function () {
it('Should add the file 1 by asking server 3', async function () {
- // Yes, this could be long
- this.timeout(200000)
+ this.timeout(10000)
const res = await getVideosList(servers[2].url)
})
it('Should add the file 2 by asking server 1', async function () {
- // Yes, this could be long
- this.timeout(200000)
+ this.timeout(10000)
const res = await getVideosList(servers[0].url)
})
it('Should add the file 3 by asking server 2', async function () {
- // Yes, this could be long
- this.timeout(200000)
+ this.timeout(10000)
const res = await getVideosList(servers[1].url)
})
it('Should add the file 3-2 by asking server 1', async function () {
- // Yes, this could be long
- this.timeout(200000)
+ this.timeout(10000)
const res = await getVideosList(servers[0].url)
})
it('Should add the file 2 in 360p by asking server 1', async function () {
- // Yes, this could be long
- this.timeout(200000)
+ this.timeout(10000)
const res = await getVideosList(servers[0].url)
})
it('Should view multiple videos on owned servers', async function () {
- this.timeout(30000)
+ this.timeout(10000)
const tasks: Promise<any>[] = []
tasks.push(getVideo(servers[2].url, localVideosServer3[0]))
await Promise.all(tasks)
- await wait(22000)
+ await wait(5000)
for (const server of servers) {
const res = await getVideosList(server.url)
})
it('Should view multiple videos on each servers', async function () {
- this.timeout(30000)
+ this.timeout(15000)
const tasks: Promise<any>[] = []
tasks.push(getVideo(servers[0].url, remoteVideosServer1[0]))
await Promise.all(tasks)
- await wait(22000)
+ await wait(10000)
let baseVideos = null
})
it('Should like and dislikes videos on different services', async function () {
- this.timeout(30000)
+ this.timeout(20000)
const tasks: Promise<any>[] = []
tasks.push(rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like'))
await Promise.all(tasks)
- await wait(22000)
+ await wait(10000)
let baseVideos = null
for (const server of servers) {
describe('Should manipulate these videos', function () {
it('Should update the video 3 by asking server 3', async function () {
- this.timeout(15000)
+ this.timeout(10000)
const attributes = {
name: 'my super video updated',
await updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, attributes)
- await wait(11000)
+ await wait(5000)
})
it('Should have the video 3 updated on each server', async function () {
- this.timeout(200000)
+ this.timeout(10000)
for (const server of servers) {
const res = await getVideosList(server.url)
})
it('Should remove the videos 3 and 3-2 by asking server 3', async function () {
- this.timeout(15000)
+ this.timeout(10000)
await removeVideo(servers[2].url, servers[2].accessToken, toRemove[0].id)
await removeVideo(servers[2].url, servers[2].accessToken, toRemove[1].id)
- await wait(11000)
+ await wait(5000)
})
it('Should have videos 1 and 3 on each server', async function () {
let server: ServerInfo = null
before(async function () {
- this.timeout(120000)
+ this.timeout(10000)
await flushTests()
let videosListBase: any[] = null
before(async function () {
- this.timeout(120000)
+ this.timeout(10000)
await flushTests()
let userId: number
before(async function () {
- this.timeout(120000)
+ this.timeout(10000)
await flushTests()
server = await runServer(1)
let servers: ServerInfo[] = []
before(async function () {
- this.timeout(100000)
+ this.timeout(50000)
// Run servers
servers = await flushAndRunMultipleServers(2)
}
await uploadVideo(servers[1].url, servers[1].accessToken, video2Attributes)
- // Wait videos propagation
- await wait(25000)
+ // Wait videos propagation, server 2 has transcoding enabled
+ await wait(10000)
const res = await getVideosList(servers[0].url)
const videos = res.body.data
})
it('Should report abuse on a local video', async function () {
- this.timeout(15000)
+ this.timeout(10000)
const reason = 'my super bad reason'
await reportVideoAbuse(servers[0].url, servers[0].accessToken, servers[0].video.id, reason)
// We wait requests propagation, even if the server 1 is not supposed to make a request to server 2
- await wait(11000)
+ await wait(5000)
})
it('Should have 1 video abuses on server 1 and 0 on server 2', async function () {
})
it('Should report abuse on a remote video', async function () {
- this.timeout(25000)
+ this.timeout(10000)
const reason = 'my super bad reason 2'
await reportVideoAbuse(servers[0].url, servers[0].accessToken, servers[1].video.id, reason)
// We wait requests propagation
- await wait(15000)
+ await wait(5000)
})
it('Should have 2 video abuse on server 1 and 1 on server 2', async function () {
}
before(async function () {
- this.timeout(120000)
+ this.timeout(50000)
// Run servers
servers = await flushAndRunMultipleServers(2)
await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'My 1st video', description: 'A video on server 2' })
await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'My 2nd video', description: 'A video on server 2' })
- // Wait videos propagation
- await wait(50000)
+ // Wait videos propagation, server 2 has transcoding enabled
+ await wait(15000)
// Blacklist the two videos on server 1
await blacklistVideosOnServer(servers[0])
let servers: ServerInfo[] = []
before(async function () {
- this.timeout(120000)
+ this.timeout(50000)
// Run servers
servers = await flushAndRunMultipleServers(2)
}
await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
- // Wait videos propagation
- await wait(25000)
+ // Wait videos propagation, server 2 has transcoding enabled
+ await wait(10000)
const res = await getVideosList(servers[0].url)
const videos = res.body.data
let videoChannelId: number
before(async function () {
- this.timeout(120000)
+ this.timeout(10000)
await flushTests()
let longDescription = 'my super description for server 1'.repeat(50)
before(async function () {
- this.timeout(30000)
+ this.timeout(40000)
// Run servers
servers = await flushAndRunMultipleServers(2)
})
it('Should upload video with long description', async function () {
- this.timeout(30000)
+ this.timeout(10000)
const attributes = {
description: longDescription
}
await uploadVideo(servers[0].url, servers[0].accessToken, attributes)
- await wait(25000)
+ await wait(5000)
const res = await getVideosList(servers[0].url)
})
it('Should update with a short description', async function () {
- this.timeout(30000)
+ this.timeout(10000)
const attributes = {
description: 'short description'
}
await updateVideo(servers[0].url, servers[0].accessToken, videoId, attributes)
- await wait(25000)
+ await wait(5000)
})
it('Should have a small description on each server', async function () {
let unlistedVideoUUID
before(async function () {
- this.timeout(120000)
+ this.timeout(50000)
// Run servers
servers = await flushAndRunMultipleServers(2)
})
it('Should upload a private video on server 1', async function () {
- this.timeout(25000)
+ this.timeout(10000)
const attributes = {
privacy: VideoPrivacy.PRIVATE
}
await uploadVideo(servers[0].url, servers[0].accessToken, attributes)
- await wait(15000)
+ await wait(5000)
})
it('Should not have this private video on server 2', async function () {
})
it('Should upload an unlisted video on server 2', async function () {
- this.timeout(50000)
+ this.timeout(30000)
const attributes = {
name: 'unlisted video',
}
await uploadVideo(servers[1].url, servers[1].accessToken, attributes)
- await wait(40000)
+ // Server 2 has transcoding enabled
+ await wait(10000)
})
it('Should not have this unlisted video listed on server 1 and 2', async function () {
})
it('Should update the private video to public on server 1', async function () {
- this.timeout(40000)
+ this.timeout(10000)
const attribute = {
name: 'super video public',
await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute)
- await wait(30000)
+ await wait(5000)
})
it('Should have this new public video listed on server 1 and 2', async function () {
let servers: ServerInfo[] = []
before(async function () {
- this.timeout(60000)
+ this.timeout(10000)
// Run servers
servers = await flushAndRunMultipleServers(2)
}
await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
- await wait(30000)
+ await wait(10000)
const res = await getVideosList(servers[0].url)
const video = res.body.data[0]
}
await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
- await wait(30000)
+ await wait(10000)
const res = await getVideosList(servers[1].url)
.send({ 'hosts': followingHosts })
.expect(expectedStatus)
- // Wait request propagation
- await wait(20000)
-
return res
}
follow(server2.url, [ server1.url ], server2.accessToken)
])
+ // Wait request propagation
+ await wait(20000)
+
return true
}