diff --git a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js index f19164fdd6027e..d0cc7091d77679 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js +++ b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js @@ -25,27 +25,25 @@ import { setupUsers, DEFAULT_SUPERUSER_PASS } from './auth'; export async function runElasticsearch({ config, options }) { const { log, esFrom } = options; - const securityEnabled = config.get('esTestCluster.securityEnabled'); + const license = config.get('esTestCluster.license'); + const isTrialLicense = config.get('esTestCluster.license') === 'trial'; const cluster = createEsTestCluster({ port: config.get('servers.elasticsearch.port'), - password: securityEnabled + password: isTrialLicense ? DEFAULT_SUPERUSER_PASS : config.get('servers.elasticsearch.password'), - license: config.get('esTestCluster.license'), + license, log, basePath: resolve(KIBANA_ROOT, '.es'), esFrom: esFrom || config.get('esTestCluster.from'), }); - const esArgs = [ - ...config.get('esTestCluster.serverArgs'), - ...(securityEnabled ? ['xpack.security.enabled=true'] : []), - ]; + const esArgs = config.get('esTestCluster.serverArgs'); await cluster.start(esArgs); - if (securityEnabled) { + if (isTrialLicense) { await setupUsers(log, config); } diff --git a/src/functional_test_runner/lib/config/schema.js b/src/functional_test_runner/lib/config/schema.js index 6c3d07f04fd6ab..faf7de7fea9403 100644 --- a/src/functional_test_runner/lib/config/schema.js +++ b/src/functional_test_runner/lib/config/schema.js @@ -117,7 +117,6 @@ export const schema = Joi.object().keys({ license: Joi.string().default('oss'), from: Joi.string().default('snapshot'), serverArgs: Joi.array(), - securityEnabled: Joi.boolean().default(false), }).default(), kbnTestServer: Joi.object().keys({ diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 9fe631bf298c1d..5f4cb60fa81e88 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -140,9 +140,9 @@ export default async function ({ readConfigFile }) { esTestCluster: { license: 'trial', from: 'snapshot', - securityEnabled: true, serverArgs: [ 'xpack.license.self_generated.type=trial', + 'xpack.security.enabled=true', ], }, diff --git a/x-pack/test/saved_object_api_integration/common/config.js b/x-pack/test/saved_object_api_integration/common/config.js index 86580bdf77e88d..15dce485d5dc21 100644 --- a/x-pack/test/saved_object_api_integration/common/config.js +++ b/x-pack/test/saved_object_api_integration/common/config.js @@ -9,7 +9,7 @@ import { resolveKibanaPath } from '@kbn/plugin-helpers'; import { EsProvider } from './services/es'; -export function createTestConfig(name, { license = 'trial', disabledPlugins = [], securityEnabled = true } = {}) { +export function createTestConfig(name, { license = 'trial', disabledPlugins = [] } = {}) { return async function ({ readConfigFile }) { @@ -28,11 +28,6 @@ export function createTestConfig(name, { license = 'trial', disabledPlugins = [] servers: config.xpack.api.get('servers'), services: { es: EsProvider, - // Provide license and list of disabled plugins to tests so they can alter their configuration - testEnv: () => ({ - license, - disabledPlugins, - }), esSupertestWithoutAuth: config.xpack.api.get('services.esSupertestWithoutAuth'), supertest: config.kibana.api.get('services.supertest'), supertestWithoutAuth: config.xpack.api.get('services.supertestWithoutAuth'), @@ -48,11 +43,11 @@ export function createTestConfig(name, { license = 'trial', disabledPlugins = [] }, esTestCluster: { + ...config.xpack.api.get('esTestCluster'), license, - from: 'snapshot', - securityEnabled, serverArgs: [ - ...license === 'trial' ? ['xpack.license.self_generated.type=trial'] : [], + `xpack.license.self_generated.type=${license}`, + `xpack.security.enabled=${!disabledPlugins.includes('security') && license === 'trial'}`, ], }, @@ -62,8 +57,8 @@ export function createTestConfig(name, { license = 'trial', disabledPlugins = [] ...config.xpack.api.get('kbnTestServer.serverArgs'), '--optimize.enabled=false', '--server.xsrf.disableProtection=true', + `--plugin-path=${path.join(__dirname, 'fixtures', 'namespace_agnostic_type_plugin')}`, ...disabledPlugins.map(key => `--xpack.${key}.enabled=false`), - `--plugin-path=${path.join(__dirname, 'fixtures', 'namespace_agnostic_type_plugin')}` ], }, }; diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/config.js b/x-pack/test/saved_object_api_integration/security_and_spaces/config.js index d63841d2cec3cb..5873a050577d7b 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/config.js +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/config.js @@ -6,4 +6,4 @@ import { createTestConfig } from '../common/config'; -export default createTestConfig('security_and_spaces', { license: 'trial', securityEnabled: true }); +export default createTestConfig('security_and_spaces', { license: 'trial' });