Skip to content

Commit

Permalink
Copy esArchiver commands from ./reassign.ts to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Apr 13, 2021
1 parent c937fc3 commit 4aeb9f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions x-pack/test/fleet_api_integration/apis/agents/unenroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`,
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 4aeb9f5

Please sign in to comment.