]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-permanent.ts
Introduce config command
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-permanent.ts
index 1128e993cae2f1574e271a39873b77c09b0e0e74..b9e37c834478e2ce89e16f177d48b27d6220a4dc 100644 (file)
@@ -5,6 +5,7 @@ import * as chai from 'chai'
 import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models'
 import {
   cleanupTests,
+  ConfigCommand,
   createLive,
   doubleFollow,
   flushAndRunMultipleServers,
@@ -16,7 +17,6 @@ import {
   setAccessTokensToServers,
   setDefaultVideoChannel,
   stopFfmpeg,
-  updateCustomSubConfig,
   updateLive,
   wait,
   waitJobs,
@@ -26,7 +26,7 @@ import {
 
 const expect = chai.expect
 
-describe('Permenant live', function () {
+describe('Permanent live', function () {
   let servers: ServerInfo[] = []
   let videoUUID: string
 
@@ -62,20 +62,15 @@ describe('Permenant live', function () {
     // Server 1 and server 2 follow each other
     await doubleFollow(servers[0], servers[1])
 
-    await updateCustomSubConfig(servers[0].url, servers[0].accessToken, {
-      live: {
-        enabled: true,
-        allowReplay: true,
-        maxDuration: -1,
-        transcoding: {
+    await servers[0].configCommand.updateCustomSubConfig({
+      newConfig: {
+        live: {
           enabled: true,
-          resolutions: {
-            '240p': true,
-            '360p': true,
-            '480p': true,
-            '720p': true,
-            '1080p': true,
-            '2160p': true
+          allowReplay: true,
+          maxDuration: -1,
+          transcoding: {
+            enabled: true,
+            resolutions: ConfigCommand.getCustomConfigResolutions(true)
           }
         }
       }
@@ -112,7 +107,7 @@ describe('Permenant live', function () {
   })
 
   it('Should stream into this permanent live', async function () {
-    this.timeout(60000)
+    this.timeout(120000)
 
     const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, videoUUID)
 
@@ -151,20 +146,15 @@ describe('Permenant live', function () {
   it('Should be able to stream again in the permanent live', async function () {
     this.timeout(20000)
 
-    await updateCustomSubConfig(servers[0].url, servers[0].accessToken, {
-      live: {
-        enabled: true,
-        allowReplay: true,
-        maxDuration: -1,
-        transcoding: {
+    await servers[0].configCommand.updateCustomSubConfig({
+      newConfig: {
+        live: {
           enabled: true,
-          resolutions: {
-            '240p': false,
-            '360p': false,
-            '480p': false,
-            '720p': false,
-            '1080p': false,
-            '2160p': false
+          allowReplay: true,
+          maxDuration: -1,
+          transcoding: {
+            enabled: true,
+            resolutions: ConfigCommand.getCustomConfigResolutions(false)
           }
         }
       }