Add ability to disable federation

This commit is contained in:
Chocobozzz
2024-08-14 14:12:37 +02:00
parent 7d52f17a35
commit e6de476ae8
7 changed files with 34 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ import {
cleanupTests,
createMultipleServers,
doubleFollow,
makeActivityPubGetRequest,
makeGetRequest,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
@@ -315,6 +317,26 @@ describe('Test follow constraints', function () {
})
})
describe('When disabling federation', function () {
before(async function () {
this.timeout(60_000)
await servers[0].kill()
await servers[0].run({ federation: { enabled: false } })
})
it('Should not federate anymore', async function () {
const { uuid } = await servers[0].videos.quickUpload({ name: 'non federated video' })
await waitJobs(servers)
await servers[1].videos.get({ id: uuid, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
await makeActivityPubGetRequest(servers[0].url, '/inbox', HttpStatusCode.NOT_ACCEPTABLE_406)
await makeActivityPubGetRequest(servers[0].url, '/outbox', HttpStatusCode.NOT_ACCEPTABLE_406)
})
})
after(async function () {
await cleanupTests(servers)
})