X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fobject-storage%2Fvideo-static-file-privacy.ts;h=af9d681b2a213475744c841868db28de1e5c483f;hb=d102de1b38f2877463529c3b27bd35ffef4fd8bf;hp=930c88543ba680a1e26273be084d226732e16103;hpb=2fe978744e5b74eb824e4d79c1bb9b840169f125;p=github%2FChocobozzz%2FPeerTube.git 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 @@ import { expect } from 'chai' import { basename } from 'path' -import { checkVideoFileTokenReinjection, expectStartWith } from '@server/tests/shared' +import { checkVideoFileTokenReinjection, expectStartWith, SQLCommand } from '@server/tests/shared' import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils' import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models' import { @@ -30,6 +30,7 @@ describe('Object storage for video static file privacy', function () { if (areScalewayObjectStorageTestsDisabled()) return let server: PeerTubeServer + let sqlCommand: SQLCommand let userToken: string // --------------------------------------------------------------------------- @@ -44,7 +45,7 @@ describe('Object storage for video static file privacy', function () { } for (const file of getAllFiles(video)) { - const internalFileUrl = await server.sql.getInternalFileUrl(file.id) + const internalFileUrl = await sqlCommand.getInternalFileUrl(file.id) expectStartWith(internalFileUrl, ObjectStorageCommand.getScalewayBaseUrl()) await makeRawRequest({ url: internalFileUrl, token: server.accessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) } @@ -99,6 +100,8 @@ describe('Object storage for video static file privacy', function () { await server.config.enableMinimumTranscoding() userToken = await server.users.generateUserAndToken('user1') + + sqlCommand = new SQLCommand(server) }) describe('VOD', function () { @@ -439,6 +442,7 @@ describe('Object storage for video static file privacy', function () { await server.servers.waitUntilLog('Removed files of video ' + v.url) } + await sqlCommand.cleanup() await cleanupTests([ server ]) }) })