aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/object-storage/video-static-file-privacy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/object-storage/video-static-file-privacy.ts')
-rw-r--r--server/tests/api/object-storage/video-static-file-privacy.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/tests/api/object-storage/video-static-file-privacy.ts b/server/tests/api/object-storage/video-static-file-privacy.ts
index 930c88543..af9d681b2 100644
--- a/server/tests/api/object-storage/video-static-file-privacy.ts
+++ b/server/tests/api/object-storage/video-static-file-privacy.ts
@@ -2,7 +2,7 @@
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { basename } from 'path' 4import { basename } from 'path'
5import { checkVideoFileTokenReinjection, expectStartWith } from '@server/tests/shared' 5import { checkVideoFileTokenReinjection, expectStartWith, SQLCommand } from '@server/tests/shared'
6import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils' 6import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils'
7import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models' 7import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models'
8import { 8import {
@@ -30,6 +30,7 @@ describe('Object storage for video static file privacy', function () {
30 if (areScalewayObjectStorageTestsDisabled()) return 30 if (areScalewayObjectStorageTestsDisabled()) return
31 31
32 let server: PeerTubeServer 32 let server: PeerTubeServer
33 let sqlCommand: SQLCommand
33 let userToken: string 34 let userToken: string
34 35
35 // --------------------------------------------------------------------------- 36 // ---------------------------------------------------------------------------
@@ -44,7 +45,7 @@ describe('Object storage for video static file privacy', function () {
44 } 45 }
45 46
46 for (const file of getAllFiles(video)) { 47 for (const file of getAllFiles(video)) {
47 const internalFileUrl = await server.sql.getInternalFileUrl(file.id) 48 const internalFileUrl = await sqlCommand.getInternalFileUrl(file.id)
48 expectStartWith(internalFileUrl, ObjectStorageCommand.getScalewayBaseUrl()) 49 expectStartWith(internalFileUrl, ObjectStorageCommand.getScalewayBaseUrl())
49 await makeRawRequest({ url: internalFileUrl, token: server.accessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) 50 await makeRawRequest({ url: internalFileUrl, token: server.accessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
50 } 51 }
@@ -99,6 +100,8 @@ describe('Object storage for video static file privacy', function () {
99 await server.config.enableMinimumTranscoding() 100 await server.config.enableMinimumTranscoding()
100 101
101 userToken = await server.users.generateUserAndToken('user1') 102 userToken = await server.users.generateUserAndToken('user1')
103
104 sqlCommand = new SQLCommand(server)
102 }) 105 })
103 106
104 describe('VOD', function () { 107 describe('VOD', function () {
@@ -439,6 +442,7 @@ describe('Object storage for video static file privacy', function () {
439 await server.servers.waitUntilLog('Removed files of video ' + v.url) 442 await server.servers.waitUntilLog('Removed files of video ' + v.url)
440 } 443 }
441 444
445 await sqlCommand.cleanup()
442 await cleanupTests([ server ]) 446 await cleanupTests([ server ])
443 }) 447 })
444}) 448})