import * as chai from 'chai'
import {
cleanupTests,
+ createMultipleServers,
doubleFollow,
- flushAndRunMultipleServers,
+ PeerTubeServer,
RedundancyCommand,
- ServerInfo,
setAccessTokensToServers,
waitJobs
} from '@shared/extra-utils'
describe('Test manage videos redundancy', function () {
const targets: VideoRedundanciesTarget[] = [ 'my-videos', 'remote-videos' ]
- let servers: ServerInfo[]
+ let servers: PeerTubeServer[]
let video1Server2UUID: string
let video2Server2UUID: string
let redundanciesToRemove: number[] = []
}
}
}
- servers = await flushAndRunMultipleServers(3, config)
+ servers = await createMultipleServers(3, config)
// Get the access tokens
await setAccessTokensToServers(servers)
- commands = servers.map(s => s.redundancyCommand)
+ commands = servers.map(s => s.redundancy)
{
- const { uuid } = await servers[1].videosCommand.upload({ attributes: { name: 'video 1 server 2' } })
+ const { uuid } = await servers[1].videos.upload({ attributes: { name: 'video 1 server 2' } })
video1Server2UUID = uuid
}
{
- const { uuid } = await servers[1].videosCommand.upload({ attributes: { name: 'video 2 server 2' } })
+ const { uuid } = await servers[1].videos.upload({ attributes: { name: 'video 2 server 2' } })
video2Server2UUID = uuid
}
this.timeout(120000)
await waitJobs(servers)
- await servers[0].serversCommand.waitUntilLog('Duplicated ', 10)
+ await servers[0].servers.waitUntilLog('Duplicated ', 10)
await waitJobs(servers)
const body = await commands[1].listVideos({ target: 'remote-videos' })
it('Should manually add a redundancy and list it', async function () {
this.timeout(120000)
- const uuid = (await servers[1].videosCommand.quickUpload({ name: 'video 3 server 2', privacy: VideoPrivacy.UNLISTED })).uuid
+ const uuid = (await servers[1].videos.quickUpload({ name: 'video 3 server 2', privacy: VideoPrivacy.UNLISTED })).uuid
await waitJobs(servers)
- const videoId = await servers[0].videosCommand.getId({ uuid })
+ const videoId = await servers[0].videos.getId({ uuid })
await commands[0].addVideo({ videoId })
await waitJobs(servers)
- await servers[0].serversCommand.waitUntilLog('Duplicated ', 15)
+ await servers[0].servers.waitUntilLog('Duplicated ', 15)
await waitJobs(servers)
{