Skip to content

Commit

Permalink
fix install_endpoint test to use bundled package
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Jan 15, 2024
1 parent 079db23 commit 0026a59
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions x-pack/test/fleet_api_integration/apis/epm/install_endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
import { skipIfNoDockerRegistry } from '../../helpers';
import { setupFleetAndAgents } from '../agents/services';
import { bundlePackage, removeBundledPackages } from './install_bundled';

export default function (providerContext: FtrProviderContext) {
/**
* There are a few features that are only currently supported for the Endpoint
* package due to security concerns.
*/
// Failing: See https://github.com/elastic/kibana/issues/156941
describe.skip('Install endpoint package', () => {
describe('Install endpoint package', () => {
const { getService } = providerContext;
skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);
Expand All @@ -25,8 +25,9 @@ export default function (providerContext: FtrProviderContext) {
const dockerServers = getService('dockerServers');
const server = dockerServers.get('registry');
const es = getService('es');
const log = getService('log');
const pkgName = 'endpoint';
let pkgVersion: string;
const pkgVersion = '8.6.1';

const transforms = [
{
Expand All @@ -39,12 +40,21 @@ export default function (providerContext: FtrProviderContext) {
},
];

const installPackage = async (name: string, version: string) => {
await supertest
.post(`/api/fleet/epm/packages/${name}/${version}`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true });
};

before(async () => {
if (!server.enabled) return;
// The latest endpoint package is already installed by default in our FTR config,
// just get the most recent version number.
const getResp = await supertest.get(`/api/fleet/epm/packages/${pkgName}`).expect(200);
pkgVersion = getResp.body.response.version;
await bundlePackage('endpoint-8.6.1');
await installPackage('endpoint', '8.6.1');
});
after(async () => {
await uninstallPackage('endpoint', '8.6.1');
await removeBundledPackages(log);
});

describe('install', () => {
Expand Down

0 comments on commit 0026a59

Please sign in to comment.