aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-09-17 09:20:52 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commitc6c0fa6cd8fe8f752463d8982c3dbcd448739c4e (patch)
tree79304b0152b0a38d33b26e65d4acdad0da4032a7 /server/tests/api
parent110d463fece85e87a26aca48a6048ae0017a27b3 (diff)
downloadPeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.gz
PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.zst
PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.zip
Live streaming implementation first step
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/config.ts16
-rw-r--r--server/tests/api/server/config.ts36
-rw-r--r--server/tests/api/videos/video-transcoder.ts2
3 files changed, 53 insertions, 1 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index 3f2708f94..35cb333ef 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -100,6 +100,22 @@ describe('Test config API validators', function () {
100 enabled: false 100 enabled: false
101 } 101 }
102 }, 102 },
103 live: {
104 enabled: true,
105
106 transcoding: {
107 enabled: true,
108 threads: 4,
109 resolutions: {
110 '240p': true,
111 '360p': true,
112 '480p': true,
113 '720p': true,
114 '1080p': true,
115 '2160p': true
116 }
117 }
118 },
103 import: { 119 import: {
104 videos: { 120 videos: {
105 http: { 121 http: {
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts
index 60efd332c..a46e179c2 100644
--- a/server/tests/api/server/config.ts
+++ b/server/tests/api/server/config.ts
@@ -64,6 +64,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
64 64
65 expect(data.user.videoQuota).to.equal(5242880) 65 expect(data.user.videoQuota).to.equal(5242880)
66 expect(data.user.videoQuotaDaily).to.equal(-1) 66 expect(data.user.videoQuotaDaily).to.equal(-1)
67
67 expect(data.transcoding.enabled).to.be.false 68 expect(data.transcoding.enabled).to.be.false
68 expect(data.transcoding.allowAdditionalExtensions).to.be.false 69 expect(data.transcoding.allowAdditionalExtensions).to.be.false
69 expect(data.transcoding.allowAudioFiles).to.be.false 70 expect(data.transcoding.allowAudioFiles).to.be.false
@@ -77,6 +78,16 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
77 expect(data.transcoding.webtorrent.enabled).to.be.true 78 expect(data.transcoding.webtorrent.enabled).to.be.true
78 expect(data.transcoding.hls.enabled).to.be.true 79 expect(data.transcoding.hls.enabled).to.be.true
79 80
81 expect(data.live.enabled).to.be.false
82 expect(data.live.transcoding.enabled).to.be.false
83 expect(data.live.transcoding.threads).to.equal(2)
84 expect(data.live.transcoding.resolutions['240p']).to.be.false
85 expect(data.live.transcoding.resolutions['360p']).to.be.false
86 expect(data.live.transcoding.resolutions['480p']).to.be.false
87 expect(data.live.transcoding.resolutions['720p']).to.be.false
88 expect(data.live.transcoding.resolutions['1080p']).to.be.false
89 expect(data.live.transcoding.resolutions['2160p']).to.be.false
90
80 expect(data.import.videos.http.enabled).to.be.true 91 expect(data.import.videos.http.enabled).to.be.true
81 expect(data.import.videos.torrent.enabled).to.be.true 92 expect(data.import.videos.torrent.enabled).to.be.true
82 expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.false 93 expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.false
@@ -150,6 +161,16 @@ function checkUpdatedConfig (data: CustomConfig) {
150 expect(data.transcoding.hls.enabled).to.be.false 161 expect(data.transcoding.hls.enabled).to.be.false
151 expect(data.transcoding.webtorrent.enabled).to.be.true 162 expect(data.transcoding.webtorrent.enabled).to.be.true
152 163
164 expect(data.live.enabled).to.be.true
165 expect(data.live.transcoding.enabled).to.be.true
166 expect(data.live.transcoding.threads).to.equal(4)
167 expect(data.live.transcoding.resolutions['240p']).to.be.true
168 expect(data.live.transcoding.resolutions['360p']).to.be.true
169 expect(data.live.transcoding.resolutions['480p']).to.be.true
170 expect(data.live.transcoding.resolutions['720p']).to.be.true
171 expect(data.live.transcoding.resolutions['1080p']).to.be.true
172 expect(data.live.transcoding.resolutions['2160p']).to.be.true
173
153 expect(data.import.videos.http.enabled).to.be.false 174 expect(data.import.videos.http.enabled).to.be.false
154 expect(data.import.videos.torrent.enabled).to.be.false 175 expect(data.import.videos.torrent.enabled).to.be.false
155 expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.true 176 expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.true
@@ -301,6 +322,21 @@ describe('Test config', function () {
301 enabled: false 322 enabled: false
302 } 323 }
303 }, 324 },
325 live: {
326 enabled: true,
327 transcoding: {
328 enabled: true,
329 threads: 4,
330 resolutions: {
331 '240p': true,
332 '360p': true,
333 '480p': true,
334 '720p': true,
335 '1080p': true,
336 '2160p': true
337 }
338 }
339 },
304 import: { 340 import: {
305 videos: { 341 videos: {
306 http: { 342 http: {
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index e3fd0ec22..a1959e1a9 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -83,7 +83,7 @@ describe('Test video transcoding', function () {
83 }) 83 })
84 84
85 it('Should transcode video on server 2', async function () { 85 it('Should transcode video on server 2', async function () {
86 this.timeout(60000) 86 this.timeout(120000)
87 87
88 const videoAttributes = { 88 const videoAttributes = {
89 name: 'my super name for server 2', 89 name: 'my super name for server 2',