diff options
Diffstat (limited to 'server/tests/api/live/live-permanent.ts')
-rw-r--r-- | server/tests/api/live/live-permanent.ts | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts index 707f2edf8..900bd6f5c 100644 --- a/server/tests/api/live/live-permanent.ts +++ b/server/tests/api/live/live-permanent.ts | |||
@@ -24,20 +24,20 @@ describe('Permanent live', function () { | |||
24 | 24 | ||
25 | async function createLiveWrapper (permanentLive: boolean) { | 25 | async function createLiveWrapper (permanentLive: boolean) { |
26 | const attributes: LiveVideoCreate = { | 26 | const attributes: LiveVideoCreate = { |
27 | channelId: servers[0].videoChannel.id, | 27 | channelId: servers[0].store.channel.id, |
28 | privacy: VideoPrivacy.PUBLIC, | 28 | privacy: VideoPrivacy.PUBLIC, |
29 | name: 'my super live', | 29 | name: 'my super live', |
30 | saveReplay: false, | 30 | saveReplay: false, |
31 | permanentLive | 31 | permanentLive |
32 | } | 32 | } |
33 | 33 | ||
34 | const { uuid } = await servers[0].liveCommand.create({ fields: attributes }) | 34 | const { uuid } = await servers[0].live.create({ fields: attributes }) |
35 | return uuid | 35 | return uuid |
36 | } | 36 | } |
37 | 37 | ||
38 | async function checkVideoState (videoId: string, state: VideoState) { | 38 | async function checkVideoState (videoId: string, state: VideoState) { |
39 | for (const server of servers) { | 39 | for (const server of servers) { |
40 | const video = await server.videosCommand.get({ id: videoId }) | 40 | const video = await server.videos.get({ id: videoId }) |
41 | expect(video.state.id).to.equal(state) | 41 | expect(video.state.id).to.equal(state) |
42 | } | 42 | } |
43 | } | 43 | } |
@@ -54,7 +54,7 @@ describe('Permanent live', function () { | |||
54 | // Server 1 and server 2 follow each other | 54 | // Server 1 and server 2 follow each other |
55 | await doubleFollow(servers[0], servers[1]) | 55 | await doubleFollow(servers[0], servers[1]) |
56 | 56 | ||
57 | await servers[0].configCommand.updateCustomSubConfig({ | 57 | await servers[0].config.updateCustomSubConfig({ |
58 | newConfig: { | 58 | newConfig: { |
59 | live: { | 59 | live: { |
60 | enabled: true, | 60 | enabled: true, |
@@ -75,14 +75,14 @@ describe('Permanent live', function () { | |||
75 | const videoUUID = await createLiveWrapper(false) | 75 | const videoUUID = await createLiveWrapper(false) |
76 | 76 | ||
77 | { | 77 | { |
78 | const live = await servers[0].liveCommand.get({ videoId: videoUUID }) | 78 | const live = await servers[0].live.get({ videoId: videoUUID }) |
79 | expect(live.permanentLive).to.be.false | 79 | expect(live.permanentLive).to.be.false |
80 | } | 80 | } |
81 | 81 | ||
82 | await servers[0].liveCommand.update({ videoId: videoUUID, fields: { permanentLive: true } }) | 82 | await servers[0].live.update({ videoId: videoUUID, fields: { permanentLive: true } }) |
83 | 83 | ||
84 | { | 84 | { |
85 | const live = await servers[0].liveCommand.get({ videoId: videoUUID }) | 85 | const live = await servers[0].live.get({ videoId: videoUUID }) |
86 | expect(live.permanentLive).to.be.true | 86 | expect(live.permanentLive).to.be.true |
87 | } | 87 | } |
88 | }) | 88 | }) |
@@ -92,7 +92,7 @@ describe('Permanent live', function () { | |||
92 | 92 | ||
93 | videoUUID = await createLiveWrapper(true) | 93 | videoUUID = await createLiveWrapper(true) |
94 | 94 | ||
95 | const live = await servers[0].liveCommand.get({ videoId: videoUUID }) | 95 | const live = await servers[0].live.get({ videoId: videoUUID }) |
96 | expect(live.permanentLive).to.be.true | 96 | expect(live.permanentLive).to.be.true |
97 | 97 | ||
98 | await waitJobs(servers) | 98 | await waitJobs(servers) |
@@ -101,16 +101,16 @@ describe('Permanent live', function () { | |||
101 | it('Should stream into this permanent live', async function () { | 101 | it('Should stream into this permanent live', async function () { |
102 | this.timeout(120000) | 102 | this.timeout(120000) |
103 | 103 | ||
104 | const ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: videoUUID }) | 104 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUID }) |
105 | 105 | ||
106 | for (const server of servers) { | 106 | for (const server of servers) { |
107 | await server.liveCommand.waitUntilPublished({ videoId: videoUUID }) | 107 | await server.live.waitUntilPublished({ videoId: videoUUID }) |
108 | } | 108 | } |
109 | 109 | ||
110 | await checkVideoState(videoUUID, VideoState.PUBLISHED) | 110 | await checkVideoState(videoUUID, VideoState.PUBLISHED) |
111 | 111 | ||
112 | await stopFfmpeg(ffmpegCommand) | 112 | await stopFfmpeg(ffmpegCommand) |
113 | await servers[0].liveCommand.waitUntilWaiting({ videoId: videoUUID }) | 113 | await servers[0].live.waitUntilWaiting({ videoId: videoUUID }) |
114 | 114 | ||
115 | await waitJobs(servers) | 115 | await waitJobs(servers) |
116 | }) | 116 | }) |
@@ -122,7 +122,7 @@ describe('Permanent live', function () { | |||
122 | await waitJobs(servers) | 122 | await waitJobs(servers) |
123 | 123 | ||
124 | for (const server of servers) { | 124 | for (const server of servers) { |
125 | const videoDetails = await server.videosCommand.get({ id: videoUUID }) | 125 | const videoDetails = await server.videos.get({ id: videoUUID }) |
126 | expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) | 126 | expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) |
127 | } | 127 | } |
128 | }) | 128 | }) |
@@ -136,7 +136,7 @@ describe('Permanent live', function () { | |||
136 | it('Should be able to stream again in the permanent live', async function () { | 136 | it('Should be able to stream again in the permanent live', async function () { |
137 | this.timeout(20000) | 137 | this.timeout(20000) |
138 | 138 | ||
139 | await servers[0].configCommand.updateCustomSubConfig({ | 139 | await servers[0].config.updateCustomSubConfig({ |
140 | newConfig: { | 140 | newConfig: { |
141 | live: { | 141 | live: { |
142 | enabled: true, | 142 | enabled: true, |
@@ -150,15 +150,15 @@ describe('Permanent live', function () { | |||
150 | } | 150 | } |
151 | }) | 151 | }) |
152 | 152 | ||
153 | const ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: videoUUID }) | 153 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUID }) |
154 | 154 | ||
155 | for (const server of servers) { | 155 | for (const server of servers) { |
156 | await server.liveCommand.waitUntilPublished({ videoId: videoUUID }) | 156 | await server.live.waitUntilPublished({ videoId: videoUUID }) |
157 | } | 157 | } |
158 | 158 | ||
159 | await checkVideoState(videoUUID, VideoState.PUBLISHED) | 159 | await checkVideoState(videoUUID, VideoState.PUBLISHED) |
160 | 160 | ||
161 | const count = await servers[0].liveCommand.countPlaylists({ videoUUID }) | 161 | const count = await servers[0].live.countPlaylists({ videoUUID }) |
162 | // master playlist and 720p playlist | 162 | // master playlist and 720p playlist |
163 | expect(count).to.equal(2) | 163 | expect(count).to.equal(2) |
164 | 164 | ||