From 4dfd15a5071ae61f17c87474c6dbd01208863b87 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Thu, 17 Jun 2021 23:18:37 -0400 Subject: [PATCH] Migrated Ingest Node Pipeline Functional Tests to use test_user (#102409) * Used test user and added appropriate kibana privileges for Ingest Node Pipeline functional tests. * Updated ingest pipelines test config to have read permissions in advanced settings. * Updated test to account for the fact that advanced settings will be visible due to kibana permissions. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../feature_controls/ingest_pipelines_security.ts | 4 +++- .../functional/apps/ingest_pipelines/ingest_pipelines.ts | 3 +++ x-pack/test/functional/config.js | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/ingest_pipelines/feature_controls/ingest_pipelines_security.ts b/x-pack/test/functional/apps/ingest_pipelines/feature_controls/ingest_pipelines_security.ts index ea3781de58f15d..aed73d6c9858d2 100644 --- a/x-pack/test/functional/apps/ingest_pipelines/feature_controls/ingest_pipelines_security.ts +++ b/x-pack/test/functional/apps/ingest_pipelines/feature_controls/ingest_pipelines_security.ts @@ -60,7 +60,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should render the "Ingest" section with ingest pipelines', async () => { await PageObjects.common.navigateToApp('management'); const sections = await managementMenu.getSections(); - expect(sections).to.have.length(1); + // We gave the ingest node pipelines user access to advanced settings to allow them to use ingest node pipelines. + // See https://github.com/elastic/kibana/pull/102409/ + expect(sections).to.have.length(2); expect(sections[0]).to.eql({ sectionId: 'ingest', sectionLinks: ['ingest_pipelines'], diff --git a/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts b/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts index 3c0cdf4c8060c5..02819cd2615346 100644 --- a/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts +++ b/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts @@ -18,10 +18,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['common', 'ingestPipelines']); const log = getService('log'); const es = getService('es'); + const security = getService('security'); describe('Ingest Pipelines', function () { this.tags('smoke'); before(async () => { + await security.testUser.setRoles(['ingest_pipelines_user']); await pageObjects.common.navigateToApp('ingestPipelines'); }); @@ -46,6 +48,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { after(async () => { // Delete the pipeline that was created await es.ingest.deletePipeline({ id: PIPELINE.name }); + await security.testUser.restoreDefaults(); }); }); }; diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 65e870c8f7c03f..05185575850d2c 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -516,6 +516,14 @@ export default async function ({ readConfigFile }) { elasticsearch: { cluster: ['manage_pipeline', 'cluster:monitor/nodes/info'], }, + kibana: [ + { + feature: { + advancedSettings: ['read'], + }, + spaces: ['*'], + }, + ], }, license_management_user: {