From df3d0a60e9c3d3f00bdf98711f2157ed256a2a0f Mon Sep 17 00:00:00 2001 From: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:57:16 +0200 Subject: [PATCH] [Fleet] fix endpoint test (#167748) ## Summary Closes https://github.com/elastic/kibana/issues/167729 Getting an error with package verification, added a workaround to force install the package first. ``` status: 400, text: '{"statusCode":400,"error":"Bad Request","message":"endpoint-8.10.2 failed signature verification.","attributes":{"type":"verification_failed"}}', method: 'POST', path: '/api/fleet/package_policies' }, ``` --------- Co-authored-by: Alex Szabo --- .../apis/agent_policy/agent_policy.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts b/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts index 6cf131939807..dc7ee034bfbc 100644 --- a/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts +++ b/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts @@ -513,6 +513,14 @@ export default function (providerContext: FtrProviderContext) { }) .expect(200); + await supertest + .post(`/api/fleet/epm/packages/endpoint/8.10.2`) + .set('kbn-xsrf', 'xxxx') + .send({ + force: true, + }) + .expect(200); + // add endpoint package policy, which is required for tamper protection await supertest .post(`/api/fleet/package_policies`)