diff options
author | Chocobozzz <me@florianbigard.com> | 2022-12-30 15:05:14 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-12-30 15:05:14 +0100 |
commit | 54db8e3d5c09fedc82d8421529c81255760a5ac2 (patch) | |
tree | 5fc316042884ff6ae9b31e51be61819acc5b42c3 /server/tests/shared | |
parent | fc83f323a85112a0f71879b6936ecfbd34e7f2e6 (diff) | |
download | PeerTube-54db8e3d5c09fedc82d8421529c81255760a5ac2.tar.gz PeerTube-54db8e3d5c09fedc82d8421529c81255760a5ac2.tar.zst PeerTube-54db8e3d5c09fedc82d8421529c81255760a5ac2.zip |
Fix P2P with object storage
Diffstat (limited to 'server/tests/shared')
-rw-r--r-- | server/tests/shared/live.ts | 8 | ||||
-rw-r--r-- | server/tests/shared/streaming-playlists.ts | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/server/tests/shared/live.ts b/server/tests/shared/live.ts index 47e0dc481..1c868eb5b 100644 --- a/server/tests/shared/live.ts +++ b/server/tests/shared/live.ts | |||
@@ -6,6 +6,7 @@ import { join } from 'path' | |||
6 | import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models' | 6 | import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models' |
7 | import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands' | 7 | import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands' |
8 | import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists' | 8 | import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists' |
9 | import { sha1 } from '@shared/extra-utils' | ||
9 | 10 | ||
10 | async function checkLiveCleanup (options: { | 11 | async function checkLiveCleanup (options: { |
11 | server: PeerTubeServer | 12 | server: PeerTubeServer |
@@ -101,6 +102,13 @@ async function testVideoResolutions (options: { | |||
101 | segmentName, | 102 | segmentName, |
102 | hlsPlaylist | 103 | hlsPlaylist |
103 | }) | 104 | }) |
105 | |||
106 | if (originServer.internalServerNumber === server.internalServerNumber) { | ||
107 | const infohash = sha1(`${2 + hlsPlaylist.playlistUrl}+V${i}`) | ||
108 | const dbInfohashes = await originServer.sql.getPlaylistInfohash(hlsPlaylist.id) | ||
109 | |||
110 | expect(dbInfohashes).to.include(infohash) | ||
111 | } | ||
104 | } | 112 | } |
105 | } | 113 | } |
106 | } | 114 | } |
diff --git a/server/tests/shared/streaming-playlists.ts b/server/tests/shared/streaming-playlists.ts index 5c62af812..75e135c4e 100644 --- a/server/tests/shared/streaming-playlists.ts +++ b/server/tests/shared/streaming-playlists.ts | |||
@@ -40,6 +40,8 @@ async function checkSegmentHash (options: { | |||
40 | expect(sha256(segmentBody)).to.equal(shaBody[videoName][range]) | 40 | expect(sha256(segmentBody)).to.equal(shaBody[videoName][range]) |
41 | } | 41 | } |
42 | 42 | ||
43 | // --------------------------------------------------------------------------- | ||
44 | |||
43 | async function checkLiveSegmentHash (options: { | 45 | async function checkLiveSegmentHash (options: { |
44 | server: PeerTubeServer | 46 | server: PeerTubeServer |
45 | baseUrlSegment: string | 47 | baseUrlSegment: string |
@@ -56,6 +58,8 @@ async function checkLiveSegmentHash (options: { | |||
56 | expect(sha256(segmentBody)).to.equal(shaBody[segmentName]) | 58 | expect(sha256(segmentBody)).to.equal(shaBody[segmentName]) |
57 | } | 59 | } |
58 | 60 | ||
61 | // --------------------------------------------------------------------------- | ||
62 | |||
59 | async function checkResolutionsInMasterPlaylist (options: { | 63 | async function checkResolutionsInMasterPlaylist (options: { |
60 | server: PeerTubeServer | 64 | server: PeerTubeServer |
61 | playlistUrl: string | 65 | playlistUrl: string |