+
+ it('Should install a plugin in requested version', async function () {
+ this.timeout(60000)
+
+ await cliCommand.execWithEnv(`${cmd} plugins install --npm-name peertube-plugin-hello-world --plugin-version 0.0.17`)
+ })
+
+ it('Should list installed plugins, in correct version', async function () {
+ const res = await cliCommand.execWithEnv(`${cmd} plugins list`)
+
+ expect(res).to.contain('peertube-plugin-hello-world')
+ expect(res).to.contain('0.0.17')
+ })
+
+ it('Should uninstall the plugin again', async function () {
+ const res = await cliCommand.execWithEnv(`${cmd} plugins uninstall --npm-name peertube-plugin-hello-world`)
+
+ expect(res).to.not.contain('peertube-plugin-hello-world')
+ })
+ })
+
+ describe('Manage video redundancies', function () {
+ let anotherServer: PeerTubeServer
+ let video1Server2: number
+ let servers: PeerTubeServer[]
+
+ before(async function () {
+ this.timeout(120000)
+
+ anotherServer = await createSingleServer(2)
+ await setAccessTokensToServers([ anotherServer ])
+
+ await doubleFollow(server, anotherServer)
+
+ servers = [ server, anotherServer ]
+ await waitJobs(servers)
+
+ const { uuid } = await anotherServer.videos.quickUpload({ name: 'super video' })
+ await waitJobs(servers)
+
+ video1Server2 = await server.videos.getId({ uuid })
+ })
+
+ it('Should add a redundancy', async function () {
+ this.timeout(60000)
+
+ const params = `add --video ${video1Server2}`
+ await cliCommand.execWithEnv(`${cmd} redundancy ${params}`)
+
+ await waitJobs(servers)
+ })
+
+ it('Should list redundancies', async function () {
+ this.timeout(60000)
+
+ {
+ const params = 'list-my-redundancies'
+ const stdout = await cliCommand.execWithEnv(`${cmd} redundancy ${params}`)
+
+ expect(stdout).to.contain('super video')
+ expect(stdout).to.contain(`localhost:${server.port}`)
+ }
+ })
+
+ it('Should remove a redundancy', async function () {
+ this.timeout(60000)
+
+ const params = `remove --video ${video1Server2}`
+ await cliCommand.execWithEnv(`${cmd} redundancy ${params}`)
+
+ await waitJobs(servers)
+
+ {
+ const params = 'list-my-redundancies'
+ const stdout = await cliCommand.execWithEnv(`${cmd} redundancy ${params}`)
+
+ expect(stdout).to.not.contain('super video')
+ }
+ })
+
+ after(async function () {
+ this.timeout(10000)
+
+ await cleanupTests([ anotherServer ])
+ })