Skip to content

Commit

Permalink
solve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
semd committed Feb 9, 2024
1 parent b87b706 commit 22428e6
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,12 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/genai/invoke_ai/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/genai/invoke_ai/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/ess.config.ts
Expand Down
23 changes: 16 additions & 7 deletions x-pack/test/security_solution_api_integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
"initialize-server:genai": "node ./scripts/index.js server genai trial_license_complete_tier",
"run-tests:genai": "node ./scripts/index.js runner genai trial_license_complete_tier",

"initialize-server:ea": "node ./scripts/index.js server entity_analytics trial_license_complete_tier",
"run-tests:ea": "node ./scripts/index.js runner entity_analytics trial_license_complete_tier",
"initialize-server:ea:trial_complete": "node ./scripts/index.js server entity_analytics trial_license_complete_tier",
"run-tests:ea:trial_complete": "node ./scripts/index.js runner entity_analytics trial_license_complete_tier",

"initialize-server:ea:basic_essentials": "node ./scripts/index.js server entity_analytics basic_license_essentials_tier",
"run-tests:ea:basic_essentials": "node ./scripts/index.js runner entity_analytics basic_license_essentials_tier",

"initialize-server:dr": "node ./scripts/index.js server detections_response trial_license_complete_tier",
"run-tests:dr": "node ./scripts/index.js runner detections_response trial_license_complete_tier",
Expand All @@ -35,11 +38,17 @@
"genai:server:ess": "npm run initialize-server:genai invoke_ai ess",
"genai:runner:ess": "npm run run-tests:genai invoke_ai ess essEnv",

"entity_analytics:server:serverless": "npm run initialize-server:ea risk_engine serverless",
"entity_analytics:runner:serverless": "npm run run-tests:ea risk_engine serverless serverlessEnv",
"entity_analytics:qa:serverless": "npm run run-tests:ea risk_engine serverless qaEnv",
"entity_analytics:server:ess": "npm run initialize-server:ea risk_engine ess",
"entity_analytics:runner:ess": "npm run run-tests:ea risk_engine ess essEnv",
"entity_analytics:server:serverless": "npm run initialize-server:ea:trial_complete risk_engine serverless",
"entity_analytics:runner:serverless": "npm run run-tests:ea:trial_complete risk_engine serverless serverlessEnv",
"entity_analytics:qa:serverless": "npm run run-tests:ea:trial_complete risk_engine serverless qaEnv",
"entity_analytics:server:ess": "npm run initialize-server:ea:trial_complete risk_engine ess",
"entity_analytics:runner:ess": "npm run run-tests:ea:trial_complete risk_engine ess essEnv",

"entity_analytics:essentials:server:serverless": "npm run initialize-server:ea:basic_essentials risk_engine serverless",
"entity_analytics:essentials:runner:serverless": "npm run run-tests:ea:basic_essentials risk_engine serverless serverlessEnv",
"entity_analytics:essentials:qa:serverless": "npm run run-tests:ea:basic_essentials risk_engine serverless qaEnv",
"entity_analytics:essentials:server:ess": "npm run initialize-server:ea:basic_essentials risk_engine ess",
"entity_analytics:essentials:runner:ess": "npm run run-tests:ea:basic_essentials risk_engine ess essEnv",

"exception_lists_items:server:serverless": "npm run initialize-server:lists:complete exception_lists_items serverless",
"exception_lists_items:runner:serverless": "npm run run-tests:lists:complete exception_lists_items serverless serverlessEnv",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { riskEngineRouteHelpersFactory } from '../../utils';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
const riskEngineRoutes = riskEngineRouteHelpersFactory(supertest);

describe('@serverless essentials tier api access', () => {
it('should not find init api', async () => {
await riskEngineRoutes.init(404);
});

it('should not find getStatus api', async () => {
await riskEngineRoutes.getStatus(404);
});

it('should not find enable api', async () => {
await riskEngineRoutes.enable(404);
});

it('should not find disable api', async () => {
await riskEngineRoutes.disable(404);
});

it('should not find privileges api', async () => {
await riskEngineRoutes.privileges(404);
});
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
require.resolve('../../../../../config/ess/config.base.basic')
);

return {
...functionalConfig.getAll(),
kbnTestServer: {
...functionalConfig.get('kbnTestServer'),
serverArgs: [
...functionalConfig.get('kbnTestServer.serverArgs'),
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'entityAnalyticsAssetCriticalityEnabled',
])}`,
],
},
testFiles: [require.resolve('..')],
junit: {
reportName: 'Entity Analytics - Risk Engine Integration Tests - ESS Env - Basic License',
},
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { createTestConfig } from '../../../../../config/serverless/config.base';

export default createTestConfig({
kbnTestServerArgs: [
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'entityAnalyticsAssetCriticalityEnabled',
])}`,
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify([
{ product_line: 'security', product_tier: 'essentials' },
{ product_line: 'endpoint', product_tier: 'essentials' },
{ product_line: 'cloud', product_tier: 'essentials' },
])}`,
],
testFiles: [require.resolve('..')],
junit: {
reportName:
'Entity Analytics - Risk Engine Integration Tests - Serverless Env - Essentials Tier',
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('Entity Analytics - Risk Engine', function () {
loadTestFile(require.resolve('./api_feature_access'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default createTestConfig({
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'entityAnalyticsAssetCriticalityEnabled',
])}`,
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify([
{ product_line: 'security', product_tier: 'complete' },
{ product_line: 'endpoint', product_tier: 'complete' },
{ product_line: 'cloud', product_tier: 'complete' },
])}`,
],
testFiles: [require.resolve('..')],
junit: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,41 +488,49 @@ export const riskEngineRouteHelpersFactory = (
supertest: SuperTest.SuperTest<SuperTest.Test>,
namespace?: string
) => ({
init: async () =>
init: async (expectStatusCode: number = 200) =>
await supertest
.post(routeWithNamespace(RISK_ENGINE_INIT_URL, namespace))
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send()
.expect(200),
.expect(expectStatusCode),

getStatus: async () =>
getStatus: async (expectStatusCode: number = 200) =>
await supertest
.get(routeWithNamespace(RISK_ENGINE_STATUS_URL, namespace))
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send()
.expect(200),
.expect(expectStatusCode),

enable: async () =>
enable: async (expectStatusCode: number = 200) =>
await supertest
.post(routeWithNamespace(RISK_ENGINE_ENABLE_URL, namespace))
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send()
.expect(200),
.expect(expectStatusCode),

disable: async () =>
disable: async (expectStatusCode: number = 200) =>
await supertest
.post(routeWithNamespace(RISK_ENGINE_DISABLE_URL, namespace))
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send()
.expect(200),
.expect(expectStatusCode),

privileges: async (expectStatusCode: number = 200) =>
await supertest
.get(RISK_ENGINE_PRIVILEGES_URL)
.set('elastic-api-version', '1')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send()
.expect(expectStatusCode),
});

interface Credentials {
Expand Down

0 comments on commit 22428e6

Please sign in to comment.