mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Co-authored-by: Joey F. Poon <joey.poon@elastic.co>
This commit is contained in:
parent
a09d2a8c38
commit
67f7dddba2
3 changed files with 9 additions and 3 deletions
|
@ -8,6 +8,7 @@
|
|||
import { Client } from '@elastic/elasticsearch';
|
||||
import { cloneDeep, merge } from 'lodash';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import uuid from 'uuid';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { KbnClient } from '@kbn/test';
|
||||
import { DeleteByQueryResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
|
@ -139,12 +140,13 @@ export async function indexEndpointHostDocs({
|
|||
|
||||
if (enrollFleet) {
|
||||
const { id: appliedPolicyId, name: appliedPolicyName } = hostMetadata.Endpoint.policy.applied;
|
||||
const uniqueAppliedPolicyName = `${appliedPolicyName}-${uuid.v4()}`;
|
||||
|
||||
// If we don't yet have a "real" policy record, then create it now in ingest (package config)
|
||||
if (!realPolicies[appliedPolicyId]) {
|
||||
const createdPolicies = await indexFleetEndpointPolicy(
|
||||
kbnClient,
|
||||
appliedPolicyName,
|
||||
uniqueAppliedPolicyName,
|
||||
epmEndpointPackage.version
|
||||
);
|
||||
|
||||
|
|
|
@ -402,6 +402,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(agentFullPolicy.inputs).to.eql([
|
||||
getExpectedAgentPolicyEndpointInput({
|
||||
id: policyInfo.packagePolicy.id,
|
||||
name: policyInfo.packagePolicy.name,
|
||||
meta: {
|
||||
package: {
|
||||
version: policyInfo.packageInfo.version,
|
||||
|
@ -448,6 +449,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(agentFullPolicy.inputs).to.eql([
|
||||
getExpectedAgentPolicyEndpointInput({
|
||||
id: policyInfo.packagePolicy.id,
|
||||
name: policyInfo.packagePolicy.name,
|
||||
meta: {
|
||||
package: {
|
||||
version: policyInfo.packageInfo.version,
|
||||
|
@ -486,6 +488,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(agentFullPolicyUpdated.inputs).to.eql([
|
||||
getExpectedAgentPolicyEndpointInput({
|
||||
id: policyInfo.packagePolicy.id,
|
||||
name: policyInfo.packagePolicy.name,
|
||||
revision: 3,
|
||||
meta: {
|
||||
package: {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import uuid from 'uuid';
|
||||
import { FtrProviderContext } from '../ftr_provider_context';
|
||||
import {
|
||||
CreateAgentPolicyRequest,
|
||||
|
@ -161,7 +162,7 @@ export function EndpointPolicyTestResourcesProvider({ getService }: FtrProviderC
|
|||
let agentPolicy: CreateAgentPolicyResponse['item'];
|
||||
try {
|
||||
const newAgentPolicyData: CreateAgentPolicyRequest['body'] = {
|
||||
name: 'East Coast',
|
||||
name: `East Coast ${uuid.v4()}`,
|
||||
description: 'East Coast call center',
|
||||
namespace: 'default',
|
||||
};
|
||||
|
@ -182,7 +183,7 @@ export function EndpointPolicyTestResourcesProvider({ getService }: FtrProviderC
|
|||
let packagePolicy: CreatePackagePolicyResponse['item'];
|
||||
try {
|
||||
const newPackagePolicyData: CreatePackagePolicyRequest['body'] = {
|
||||
name: 'Protect East Coast',
|
||||
name: `Protect East Coast ${uuid.v4()}`,
|
||||
description: 'Protect the worlds data - but in the East Coast',
|
||||
policy_id: agentPolicy!.id,
|
||||
enabled: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue