]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/live.ts
Fix audio encoding params
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / live.ts
index 4134fca0cd225bbd3a2daffbf92c2490c585d6ab..2b2d1beec8035ebbd18808e4c3233d5482dcdb95 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import 'mocha'
-import * as chai from 'chai'
 import { omit } from 'lodash'
 import { join } from 'path'
 import { LiveVideo, VideoPrivacy } from '@shared/models'
@@ -14,6 +13,7 @@ import {
   immutableAssign,
   makePostBodyRequest,
   makeUploadRequest,
+  runAndTestFfmpegStreamError,
   sendRTMPStream,
   ServerInfo,
   setAccessTokensToServers,
@@ -29,9 +29,7 @@ describe('Test video lives API validator', function () {
   const path = '/api/v1/videos/live'
   let server: ServerInfo
   let userAccessToken = ''
-  let accountName: string
   let channelId: number
-  let channelName: string
   let videoId: number
   let videoIdNotLive: number
 
@@ -402,6 +400,21 @@ describe('Test video lives API validator', function () {
 
       await stopFfmpeg(command)
     })
+
+    it('Should fail to stream twice in the save live', async function () {
+      this.timeout(30000)
+
+      const resLive = await getLive(server.url, server.accessToken, videoId)
+      const live: LiveVideo = resLive.body
+
+      const command = sendRTMPStream(live.rtmpUrl, live.streamKey)
+
+      await waitUntilLiveStarts(server.url, server.accessToken, videoId)
+
+      await runAndTestFfmpegStreamError(server.url, server.accessToken, videoId, true)
+
+      await stopFfmpeg(command)
+    })
   })
 
   after(async function () {