aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-04 10:07:06 +0200
committerChocobozzz <me@florianbigard.com>2022-05-04 10:32:49 +0200
commit9a82ce2455874a80167f5ae30bb19ea12eb0551e (patch)
tree0b4fe8ff0bfd00d0f3b60e047ec9d7cfdd7c0c7a /server/tests/api
parentb003d5751803e737b34dc71ce61e66a0d9d12eb4 (diff)
downloadPeerTube-9a82ce2455874a80167f5ae30bb19ea12eb0551e.tar.gz
PeerTube-9a82ce2455874a80167f5ae30bb19ea12eb0551e.tar.zst
PeerTube-9a82ce2455874a80167f5ae30bb19ea12eb0551e.zip
Fix quota inconstistencies with lives
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/live/live-constraints.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts
index cab76f425..cf43c262a 100644
--- a/server/tests/api/live/live-constraints.ts
+++ b/server/tests/api/live/live-constraints.ts
@@ -12,6 +12,7 @@ import {
12 PeerTubeServer, 12 PeerTubeServer,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 setDefaultVideoChannel, 14 setDefaultVideoChannel,
15 stopFfmpeg,
15 waitJobs, 16 waitJobs,
16 waitUntilLiveReplacedByReplayOnAllServers, 17 waitUntilLiveReplacedByReplayOnAllServers,
17 waitUntilLiveWaitingOnAllServers 18 waitUntilLiveWaitingOnAllServers
@@ -169,6 +170,30 @@ describe('Test live constraints', function () {
169 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false }) 170 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
170 }) 171 })
171 172
173 it('Should have the same quota in admin and as a user', async function () {
174 this.timeout(120000)
175
176 const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
177 const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ token: userAccessToken, videoId: userVideoLiveoId })
178
179 await servers[0].live.waitUntilPublished({ videoId: userVideoLiveoId })
180
181 await wait(3000)
182
183 const quotaUser = await servers[0].users.getMyQuotaUsed({ token: userAccessToken })
184
185 const { data } = await servers[0].users.list()
186 const quotaAdmin = data.find(u => u.username === 'user1')
187
188 expect(quotaUser.videoQuotaUsed).to.equal(quotaAdmin.videoQuotaUsed)
189 expect(quotaUser.videoQuotaUsedDaily).to.equal(quotaAdmin.videoQuotaUsedDaily)
190
191 expect(quotaUser.videoQuotaUsed).to.be.above(10)
192 expect(quotaUser.videoQuotaUsedDaily).to.be.above(10)
193
194 await stopFfmpeg(ffmpegCommand)
195 })
196
172 it('Should have max duration limit', async function () { 197 it('Should have max duration limit', async function () {
173 this.timeout(60000) 198 this.timeout(60000)
174 199