})
after(async function () {
- this.timeout(10000)
-
await sqlCommandServer2.cleanup()
await cleanupTests(servers)
describe('When checking Linked Data Signature', function () {
before(async function () {
- this.timeout(10000)
-
await setKeysOfServer(sqlCommands[0], servers[1].url, keys.publicKey, keys.privateKey)
await setKeysOfServer(sqlCommands[1], servers[1].url, keys.publicKey, keys.privateKey)
await setKeysOfServer(sqlCommands[2], servers[2].url, keys.publicKey, keys.privateKey)
})
it('Should fail with bad keys', async function () {
- this.timeout(10000)
-
await setKeysOfServer(sqlCommands[0], servers[2].url, invalidKeys.publicKey, invalidKeys.privateKey)
await setKeysOfServer(sqlCommands[2], servers[2].url, invalidKeys.publicKey, invalidKeys.privateKey)
})
it('Should fail with an altered body', async function () {
- this.timeout(10000)
-
await setKeysOfServer(sqlCommands[0], servers[2].url, keys.publicKey, keys.privateKey)
await setKeysOfServer(sqlCommands[0], servers[2].url, keys.publicKey, keys.privateKey)
})
it('Should succeed with a valid signature', async function () {
- this.timeout(10000)
-
const body = getAnnounceWithoutContext(servers[1])
body.actor = servers[2].url + '/accounts/peertube'
})
it('Should succeed with the correct parameters', async function () {
- this.timeout(10000)
-
const it = [
{ suffix: 'install', status: HttpStatusCode.OK_200 },
{ suffix: 'update', status: HttpStatusCode.OK_200 },
describe('Search target', function () {
it('Should fail/succeed depending on the search target', async function () {
- this.timeout(10000)
-
const query = { search: 'coucou' }
const paths = [
'/api/v1/search/video-playlists/',
})
it('Should update the live', async function () {
- this.timeout(10000)
-
await commands[0].update({ videoId: liveVideoUUID, fields: { saveReplay: false, latencyMode: LiveVideoLatencyMode.DEFAULT } })
await waitJobs(servers)
})
})
it('Delete the live', async function () {
- this.timeout(10000)
-
await servers[0].videos.remove({ id: liveVideoUUID })
await waitJobs(servers)
})
})
it('Should report abuse on a remote video', async function () {
- this.timeout(10000)
-
const reason = 'my super bad reason 2'
const videoId = await servers[0].videos.getId({ uuid: servers[1].store.videoCreated.uuid })
await commands[0].report({ videoId, reason })
})
it('Should hide video abuses from blocked accounts', async function () {
- this.timeout(10000)
-
{
const videoId = await servers[1].videos.getId({ uuid: servers[0].store.videoCreated.uuid })
await commands[1].report({ videoId, reason: 'will mute this' })
})
it('Should keep the video abuse when deleting the video', async function () {
- this.timeout(10000)
-
await servers[1].videos.remove({ id: abuseServer2.video.uuid })
await waitJobs(servers)
})
it('Should include counts of reports from reporter and reportee', async function () {
- this.timeout(10000)
-
// register a second user to have two reporters/reportees
const user = { username: 'user2', password: 'password' }
await servers[0].users.create({ ...user })
})
it('Should list predefined reasons as well as timestamps for the reported video', async function () {
- this.timeout(10000)
-
const reason5 = 'my super bad reason 5'
const predefinedReasons5: AbusePredefinedReasonsString[] = [ 'violentOrRepulsive', 'captions' ]
const createRes = await commands[0].report({
})
it('Should delete the video abuse', async function () {
- this.timeout(10000)
-
await commands[1].delete({ abuseId: abuseServer2.id })
await waitJobs(servers)
})
it('Should list and filter video abuses', async function () {
- this.timeout(10000)
-
async function list (query: Parameters<AbusesCommand['getAdminList']>[0]) {
const body = await commands[0].getAdminList(query)
})
it('Should report abuse on a remote comment', async function () {
- this.timeout(10000)
-
const comment = await getComment(servers[0], servers[1].store.videoCreated.uuid)
const reason = 'it is a really bad comment'
})
it('Should keep the comment abuse when deleting the comment', async function () {
- this.timeout(10000)
-
const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.uuid)
await servers[0].comments.delete({ videoId: servers[1].store.videoCreated.uuid, commentId: commentServer2.id })
})
it('Should delete the comment abuse', async function () {
- this.timeout(10000)
-
await commands[1].delete({ abuseId: abuseServer2.id })
await waitJobs(servers)
})
it('Should report abuse on a remote account', async function () {
- this.timeout(10000)
-
const account = await getAccountFromServer(servers[0], 'user_2', servers[1])
const reason = 'it is a really bad account'
})
it('Should keep the account abuse when deleting the account', async function () {
- this.timeout(10000)
-
const account = await getAccountFromServer(servers[1], 'user_2', servers[1])
await servers[1].users.remove({ userId: account.userId })
})
it('Should delete the account abuse', async function () {
- this.timeout(10000)
-
await commands[1].delete({ abuseId: abuseServer2.id })
await waitJobs(servers)
})
it('Should block an account', async function () {
- this.timeout(10000)
-
await servers[0].blocklist.addToMyBlocklist({ token: userToken1, account: 'user3@' + servers[1].host })
await waitJobs(servers)
})
})
it('Should block an account', async function () {
- this.timeout(10000)
-
await servers[0].blocklist.addToMyBlocklist({ token: userToken1, server: servers[1].host })
await waitJobs(servers)
})
})
it('Should block an account', async function () {
- this.timeout(10000)
-
await servers[0].blocklist.addToServerBlocklist({ account: 'user3@' + servers[1].host })
await waitJobs(servers)
})
})
it('Should block an account', async function () {
- this.timeout(10000)
-
await servers[0].blocklist.addToServerBlocklist({ server: servers[1].host })
await waitJobs(servers)
})
})
it('Should hide its comments', async function () {
- this.timeout(10000)
-
const { id } = await commentsCommand[1].createThread({ token: userToken2, videoId: videoUUID1, text: 'hidden comment 2' })
await waitJobs(servers)
})
it('Should hide its comments', async function () {
- this.timeout(10000)
-
const { id } = await commentsCommand[1].createThread({ token: userToken2, videoId: videoUUID1, text: 'hidden comment 2' })
await waitJobs(servers)
describe('Default search', async function () {
it('Should make a local videos search by default', async function () {
- this.timeout(10000)
-
await server.config.updateCustomSubConfig({
newConfig: {
search: {
})
it('Should send a contact form', async function () {
- this.timeout(10000)
-
await command.send({
fromEmail: 'toto@example.com',
body: 'my super message',
})
it('Should not be able to send another contact form because of the anti spam checker', async function () {
- this.timeout(10000)
-
await wait(1000)
await command.send({
describe('When creating a user without password', function () {
it('Should send a create password email', async function () {
- this.timeout(10000)
-
await server.users.create({ username: 'create_password', password: '' })
await waitJobs(server)
describe('When creating an abuse', function () {
it('Should send the notification email', async function () {
- this.timeout(10000)
-
const reason = 'my super bad reason'
await server.abuses.report({ token: userAccessToken, videoId, reason })
describe('When blocking/unblocking user', function () {
it('Should send the notification email when blocking a user', async function () {
- this.timeout(10000)
-
const reason = 'my super bad reason'
await server.users.banUser({ userId, reason })
})
it('Should send the notification email when unblocking a user', async function () {
- this.timeout(10000)
-
await server.users.unbanUser({ userId })
await waitJobs(server)
describe('When blacklisting a video', function () {
it('Should send the notification email', async function () {
- this.timeout(10000)
-
const reason = 'my super reason'
await server.blacklist.add({ videoId: videoUserUUID, reason })
})
it('Should send the notification email', async function () {
- this.timeout(10000)
-
await server.blacklist.remove({ videoId: videoUserUUID })
await waitJobs(server)
describe('When verifying a user email', function () {
it('Should ask to send the verification email', async function () {
- this.timeout(10000)
-
await server.users.askSendVerifyEmail({ email: 'user_1@example.com' })
await waitJobs(server)
})
it('Should ask to send the verification email', async function () {
- this.timeout(10000)
-
await server.registrations.askSendVerifyEmail({ email: 'request_1@example.com' })
await waitJobs(server)
})
it('Should remove follower on server 2', async function () {
- this.timeout(10000)
-
await commands[1].removeFollower({ follower: servers[0] })
await waitJobs(servers)
describe('Disabled/Enabled followers', function () {
it('Should disable followers on server 2', async function () {
- this.timeout(10000)
-
const subConfig = {
followers: {
instance: {
})
it('Should re enable followers on server 2', async function () {
- this.timeout(10000)
-
const subConfig = {
followers: {
instance: {
})
it('Should accept a follower', async function () {
- this.timeout(10000)
-
await commands[1].acceptFollower({ follower: 'peertube@' + servers[0].host })
await waitJobs(servers)
})
it('Should log ping requests', async function () {
- this.timeout(10000)
-
const now = new Date()
await server.servers.ping()
})
it('Should have watched settings changes', async function () {
- this.timeout(10000)
-
await server.servers.waitUntilLog('Settings changed!')
})
})
it('Should succeed with the correct infohash', function (done) {
- this.timeout(10000)
const webtorrent = new WebTorrent()
const torrent = webtorrent.add(goodMagnet)
})
it('Should delete videos', async function () {
- this.timeout(10000)
-
for (const uuid of videoUUIDs) {
await servers[0].videos.remove({ id: uuid })
}
})
it('Should be able to change the user email', async function () {
- this.timeout(10000)
-
let updateVerificationString: string
{
})
it('Should be able to update my display name', async function () {
- this.timeout(10000)
-
await servers[0].users.updateMe({ displayName: 'my super display name' })
user = await servers[0].users.getMyInfo()
})
it('Should upload the video', async function () {
- this.timeout(10000)
-
const attributes = {
name: 'my super name',
category: 2,
})
it('Should accept the same change ownership request without crashing', async function () {
- this.timeout(10000)
-
await command.create({ token: firstUserToken, videoId: servers[0].store.videoCreated.id, username: secondUser })
})
it('Should not create multiple change ownership requests while one is waiting', async function () {
- this.timeout(10000)
-
const body = await command.list({ token: secondUserToken })
expect(body.total).to.equal(1)
})
it('Should not be possible to refuse the change of ownership from first user', async function () {
- this.timeout(10000)
-
await command.refuse({ token: firstUserToken, ownershipId: lastRequestId, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should be possible to refuse the change of ownership from second user', async function () {
- this.timeout(10000)
-
await command.refuse({ token: secondUserToken, ownershipId: lastRequestId })
})
})
it('Should not be possible to accept the change of ownership from first user', async function () {
- this.timeout(10000)
-
await command.accept({
token: firstUserToken,
ownershipId: lastRequestId,
})
it('Should be possible to accept the change of ownership from second user', async function () {
- this.timeout(10000)
-
await command.accept({ token: secondUserToken, ownershipId: lastRequestId, channelId: secondUserChannelId })
await waitJobs(servers)
})
it('Should not be possible to accept the change of ownership from second user because of exceeded quota', async function () {
- this.timeout(10000)
-
const { videoChannels } = await server.users.getMyInfo({ token: secondUserToken })
const channelId = videoChannels[0].id
})
it('Should list the second video channel videos', async function () {
- this.timeout(10000)
-
for (const server of servers) {
const channelURI = 'second_video_channel@' + servers[0].host
const { total, data } = await server.videos.listByChannel({ handle: channelURI })
})
it('Should change the video channel of a video', async function () {
- this.timeout(10000)
-
await servers[0].videos.update({ id: videoUUID, attributes: { channelId: servers[0].store.channel.id } })
await waitJobs(servers)
})
it('Should list the first video channel videos', async function () {
- this.timeout(10000)
-
for (const server of servers) {
{
const secondChannelURI = 'second_video_channel@' + servers[0].host
})
it('Should report correct channel views per days', async function () {
- this.timeout(10000)
-
{
const { data } = await servers[0].channels.listByAccount({ accountName, withStats: true })
})
it('Should update with a short description', async function () {
- this.timeout(10000)
-
const attributes = {
description: 'short description'
}
})
it('Should not be able to watch the private video with another user', async function () {
- this.timeout(10000)
-
const user = {
username: 'hello',
password: 'super password'
})
it('Should set these videos as private and internal', async function () {
- this.timeout(10000)
-
await servers[0].videos.update({ id: internalVideoId, attributes: { privacy: VideoPrivacy.PRIVATE } })
await servers[0].videos.update({ id: privateVideoId, attributes: { privacy: VideoPrivacy.INTERNAL } })
})
it('Should upload a video and schedule an update in 10 seconds', async function () {
- this.timeout(10000)
-
const attributes = {
name: 'video 1',
privacy: VideoPrivacy.PRIVATE,
})
it('Should upload a video without scheduling an update', async function () {
- this.timeout(10000)
-
const attributes = {
name: 'video 2',
privacy: VideoPrivacy.PRIVATE
})
it('Should update a video by scheduling an update', async function () {
- this.timeout(10000)
-
const attributes = {
name: 'video 2 updated',
scheduleUpdate: {
})
it('Should upload another video and include all videos in the overview', async function () {
- this.timeout(60000)
+ this.timeout(120000)
{
for (let i = 1; i < 6; i++) {
})
after(async function () {
- this.timeout(10000)
-
await cleanupTests([ anotherServer ])
})
})
after(async function () {
- this.timeout(10000)
-
await cleanupTests([ server ])
})
})
})
it('Should auto block a video', async function () {
- this.timeout(10000)
-
await check(servers[0], server2Videos[0].uuid, true)
blocklistServer.replace({
})
it('Should not block a local video', async function () {
- this.timeout(10000)
-
await check(servers[0], server1Videos[0].uuid, true)
blocklistServer.replace({
})
it('Should remove a video block', async function () {
- this.timeout(10000)
-
await check(servers[0], server2Videos[0].uuid, false)
blocklistServer.replace({
})
it('Should add a server blocklist', async function () {
- this.timeout(10000)
-
blocklistServer.replace({
data: [
{
})
it('Should remove a server blocklist', async function () {
- this.timeout(10000)
-
blocklistServer.replace({
data: [
{
})
it('Should add an account blocklist', async function () {
- this.timeout(10000)
-
blocklistServer.replace({
data: [
{
})
it('Should remove an account blocklist', async function () {
- this.timeout(10000)
-
blocklistServer.replace({
data: [
{
})
it('Should reject token of Kefka by the plugin hook', async function () {
- this.timeout(10000)
-
await wait(5000)
await server.users.getMyInfo({ token: kefkaAccessToken, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should reject token of laguna by the plugin hook', async function () {
- this.timeout(10000)
-
await wait(5000)
await server.users.getMyInfo({ token: lagunaAccessToken, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should mute server 2', async function () {
- this.timeout(10000)
await postCommand(servers[0], 'blockServer', { hostToBlock: servers[1].host })
const { data } = await servers[0].videos.list()
})
it('Should blacklist video', async function () {
- this.timeout(10000)
-
await postCommand(servers[0], 'blacklist', { videoUUID: videoUUIDServer1, unfederate: true })
await waitJobs(servers)
})
it('Should unblacklist video', async function () {
- this.timeout(10000)
-
await postCommand(servers[0], 'unblacklist', { videoUUID: videoUUIDServer1 })
await waitJobs(servers)
const files = await readdir(directoryPath)
- expect(files).to.have.lengthOf(0)
+ expect(files, 'Directory content: ' + files.join(', ')).to.have.lengthOf(0)
}