X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-hls.ts;h=d050a7a7e29e36085ef514a25dbb4fe51a973989;hb=bf54587a3e2ad9c2c186828f2a5682b91ee2cc00;hp=2c829f53289155d7d1601a04dcc4929214ec2ef9;hpb=0305db28c98fd6cf43a3c50ba92c76215e99d512;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts index 2c829f532..d050a7a7e 100644 --- a/server/tests/api/videos/video-hls.ts +++ b/server/tests/api/videos/video-hls.ts @@ -14,13 +14,14 @@ import { createMultipleServers, doubleFollow, expectStartWith, + hlsInfohashExist, makeRawRequest, ObjectStorageCommand, PeerTubeServer, setAccessTokensToServers, waitJobs, webtorrentAdd -} from '@shared/extra-utils' +} from '@shared/server-commands' import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models' import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' @@ -88,9 +89,15 @@ async function checkHlsPlaylist (options: { const masterPlaylist = await server.streamingPlaylists.get({ url: hlsPlaylist.playlistUrl }) + let i = 0 for (const resolution of resolutions) { expect(masterPlaylist).to.contain(`${resolution}.m3u8`) expect(masterPlaylist).to.contain(`${resolution}.m3u8`) + + const url = 'http://' + videoDetails.account.host + await hlsInfohashExist(url, hlsPlaylist.playlistUrl, i) + + i++ } } @@ -101,7 +108,7 @@ async function checkHlsPlaylist (options: { const playlistName = removeFragmentedMP4Ext(basename(file.fileUrl)) + '.m3u8' const url = objectStorageBaseUrl - ? `${objectStorageBaseUrl}hls_${videoUUID}/${playlistName}` + ? `${objectStorageBaseUrl}hls/${videoUUID}/${playlistName}` : `${baseUrl}/static/streaming-playlists/hls/${videoUUID}/${playlistName}` const subPlaylist = await server.streamingPlaylists.get({ url }) @@ -113,7 +120,7 @@ async function checkHlsPlaylist (options: { { const baseUrlAndPath = objectStorageBaseUrl - ? objectStorageBaseUrl + 'hls_' + videoUUID + ? objectStorageBaseUrl + 'hls/' + videoUUID : baseUrl + '/static/streaming-playlists/hls/' + videoUUID for (const resolution of resolutions) { @@ -165,7 +172,7 @@ describe('Test HLS videos', function () { }) it('Should update the video', async function () { - this.timeout(10000) + this.timeout(30000) await servers[0].videos.update({ id: videoUUID, attributes: { name: 'video 1 updated' } }) @@ -236,6 +243,7 @@ describe('Test HLS videos', function () { enabled: true, allowAudioFiles: true, resolutions: { + '144p': false, '240p': true, '360p': true, '480p': true,