From 4aeb9f5a83c28477edb3cb3811545f6078252359 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Tue, 13 Apr 2021 13:03:03 -0400 Subject: [PATCH] Copy esArchiver commands from ./reassign.ts to fix tests --- .../test/fleet_api_integration/apis/agents/unenroll.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/test/fleet_api_integration/apis/agents/unenroll.ts b/x-pack/test/fleet_api_integration/apis/agents/unenroll.ts index ab765eae18ca5..d7e16b7e7224b 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/unenroll.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/unenroll.ts @@ -23,10 +23,12 @@ export default function (providerContext: FtrProviderContext) { let accessAPIKeyId: string; let outputAPIKeyId: string; before(async () => { - await esArchiver.load('fleet/agents'); + await esArchiver.load('fleet/empty_fleet_server'); }); setupFleetAndAgents(providerContext); beforeEach(async () => { + await esArchiver.unload('fleet/empty_fleet_server'); + await esArchiver.load('fleet/agents'); const { body: accessAPIKeyBody } = await esClient.security.createApiKey({ body: { name: `test access api key: ${uuid.v4()}`, @@ -63,8 +65,12 @@ export default function (providerContext: FtrProviderContext) { }, }); }); - after(async () => { + afterEach(async () => { await esArchiver.unload('fleet/agents'); + await esArchiver.load('fleet/empty_fleet_server'); + }); + after(async () => { + await esArchiver.unload('fleet/empty_fleet_server'); }); it('/agents/{agent_id}/unenroll should fail for managed policy', async () => {