From e693aa79b70f88477e808b44fa74db69facfffa6 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Thu, 10 Sep 2020 15:39:39 -0400 Subject: [PATCH 1/2] adding test user to maps tests under documents source --- .../maps/documents_source/docvalue_fields.js | 6 ++++++ .../apps/maps/documents_source/search_hits.js | 14 +++++++++++++ .../apps/maps/documents_source/top_hits.js | 6 ++++++ x-pack/test/functional/config.js | 20 +++++++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js index d5d82a9b743e3..744cdf681e372 100644 --- a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js +++ b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js @@ -10,12 +10,18 @@ export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps']); const inspector = getService('inspector'); const testSubjects = getService('testSubjects'); + const security = getService('security'); describe('docvalue_fields', () => { before(async () => { + await security.testUser.setRoles(['global_maps_all', 'test_logstash_reader'], false); await PageObjects.maps.loadSavedMap('document example'); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + async function getResponse() { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/documents_source/search_hits.js b/x-pack/test/functional/apps/maps/documents_source/search_hits.js index cc0f3a7df32de..810e7e370e727 100644 --- a/x-pack/test/functional/apps/maps/documents_source/search_hits.js +++ b/x-pack/test/functional/apps/maps/documents_source/search_hits.js @@ -9,12 +9,26 @@ import expect from '@kbn/expect'; export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps']); const inspector = getService('inspector'); + const security = getService('security'); describe('search hits', () => { before(async () => { + await security.testUser.setRoles( + [ + 'global_maps_all', + 'test_logstash_reader', + 'antimeridian_points_reader', + 'antimeridian_shapes_reader', + ], + false + ); await PageObjects.maps.loadSavedMap('document example'); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + async function getRequestTimestamp() { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/documents_source/top_hits.js b/x-pack/test/functional/apps/maps/documents_source/top_hits.js index 322401ee81648..4276bc9419a10 100644 --- a/x-pack/test/functional/apps/maps/documents_source/top_hits.js +++ b/x-pack/test/functional/apps/maps/documents_source/top_hits.js @@ -12,13 +12,19 @@ export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps', 'common']); const inspector = getService('inspector'); const find = getService('find'); + const security = getService('security'); describe('geo top hits', () => { describe('split on string field', () => { before(async () => { + await security.testUser.setRoles(['global_maps_all', 'test_logstash_reader'], false); await PageObjects.maps.loadSavedMap('document example top hits'); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + it('should not fetch any search hits', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 16e2cd1559fce..ce29c069decad 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -287,6 +287,26 @@ export default async function ({ readConfigFile }) { ], }, }, + antimeridian_points_reader: { + elasticsearch: { + indices: [ + { + names: ['antimeridian_points*'], + privileges: ['read', 'view_index_metadata'], + }, + ], + }, + }, + antimeridian_shapes_reader: { + elasticsearch: { + indices: [ + { + names: ['antimeridian_shapes*'], + privileges: ['read', 'view_index_metadata'], + }, + ], + }, + }, geoconnections_data_reader: { elasticsearch: { From 77e48bcd2d29254ae1bb03b5733ac7b8f7958f4e Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Mon, 14 Sep 2020 16:15:52 -0400 Subject: [PATCH 2/2] adding global_maps_read config and the role to limit the change --- .../apps/maps/documents_source/docvalue_fields.js | 2 +- x-pack/test/functional/config.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js index 744cdf681e372..4edee0a0b78ba 100644 --- a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js +++ b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js @@ -14,7 +14,7 @@ export default function ({ getPageObjects, getService }) { describe('docvalue_fields', () => { before(async () => { - await security.testUser.setRoles(['global_maps_all', 'test_logstash_reader'], false); + await security.testUser.setRoles(['global_maps_read', 'test_logstash_reader'], false); await PageObjects.maps.loadSavedMap('document example'); }); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index ccf37d55e1b94..af199854d5efe 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -287,6 +287,17 @@ export default async function ({ readConfigFile }) { ], }, + global_maps_read: { + kibana: [ + { + feature: { + maps: ['read'], + }, + spaces: ['*'], + }, + ], + }, + geoshape_data_reader: { elasticsearch: { indices: [