aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-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