aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-10-28 15:24:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commita056ca4813c82f490dcd31ac97a64d6bf76d3dcc (patch)
tree11a0638cb92eee94f404e294f54632212836a4a6 /server/tests/api
parentd846d99c6c81028bb7bd3cb20abd433cbf396a22 (diff)
downloadPeerTube-a056ca4813c82f490dcd31ac97a64d6bf76d3dcc.tar.gz
PeerTube-a056ca4813c82f490dcd31ac97a64d6bf76d3dcc.tar.zst
PeerTube-a056ca4813c82f490dcd31ac97a64d6bf76d3dcc.zip
Add max lives limit
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/config.ts2
-rw-r--r--server/tests/api/server/config.ts6
2 files changed, 8 insertions, 0 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index 2882ceb7c..42ac5e1f9 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -105,6 +105,8 @@ describe('Test config API validators', function () {
105 105
106 allowReplay: false, 106 allowReplay: false,
107 maxDuration: null, 107 maxDuration: null,
108 maxInstanceLives: -1,
109 maxUserLives: 50,
108 110
109 transcoding: { 111 transcoding: {
110 enabled: true, 112 enabled: true,
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts
index a7f035362..6c37be113 100644
--- a/server/tests/api/server/config.ts
+++ b/server/tests/api/server/config.ts
@@ -81,6 +81,8 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
81 expect(data.live.enabled).to.be.false 81 expect(data.live.enabled).to.be.false
82 expect(data.live.allowReplay).to.be.true 82 expect(data.live.allowReplay).to.be.true
83 expect(data.live.maxDuration).to.equal(1000 * 3600 * 5) 83 expect(data.live.maxDuration).to.equal(1000 * 3600 * 5)
84 expect(data.live.maxInstanceLives).to.equal(20)
85 expect(data.live.maxUserLives).to.equal(3)
84 expect(data.live.transcoding.enabled).to.be.false 86 expect(data.live.transcoding.enabled).to.be.false
85 expect(data.live.transcoding.threads).to.equal(2) 87 expect(data.live.transcoding.threads).to.equal(2)
86 expect(data.live.transcoding.resolutions['240p']).to.be.false 88 expect(data.live.transcoding.resolutions['240p']).to.be.false
@@ -166,6 +168,8 @@ function checkUpdatedConfig (data: CustomConfig) {
166 expect(data.live.enabled).to.be.true 168 expect(data.live.enabled).to.be.true
167 expect(data.live.allowReplay).to.be.false 169 expect(data.live.allowReplay).to.be.false
168 expect(data.live.maxDuration).to.equal(5000) 170 expect(data.live.maxDuration).to.equal(5000)
171 expect(data.live.maxInstanceLives).to.equal(-1)
172 expect(data.live.maxUserLives).to.equal(10)
169 expect(data.live.transcoding.enabled).to.be.true 173 expect(data.live.transcoding.enabled).to.be.true
170 expect(data.live.transcoding.threads).to.equal(4) 174 expect(data.live.transcoding.threads).to.equal(4)
171 expect(data.live.transcoding.resolutions['240p']).to.be.true 175 expect(data.live.transcoding.resolutions['240p']).to.be.true
@@ -330,6 +334,8 @@ describe('Test config', function () {
330 enabled: true, 334 enabled: true,
331 allowReplay: false, 335 allowReplay: false,
332 maxDuration: 5000, 336 maxDuration: 5000,
337 maxInstanceLives: -1,
338 maxUserLives: 10,
333 transcoding: { 339 transcoding: {
334 enabled: true, 340 enabled: true,
335 threads: 4, 341 threads: 4,