Fix management test to run against cloud (#138656) (#138664)

* Fix test to run against cloud

* Keep original names

(cherry picked from commit 94b51c4da5)

Co-authored-by: liza-mae <liza-mae@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-08-11 16:13:33 -04:00 committed by GitHub
parent fc9060a86b
commit 3730c97ad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 3 deletions

View file

@ -12,9 +12,12 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['settings']);
const es = getService('es');
const security = getService('security');
describe('creating and deleting default index', function describeIndexTests() {
it('data view creation with exclusion', async () => {
before(async function () {
await security.testUser.setRoles(['kibana_admin', 'index_a', 'index_b']);
await PageObjects.settings.navigateTo();
await es.transport.request({
path: '/index-a/_doc',
method: 'POST',
@ -26,13 +29,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
method: 'POST',
body: { title: 'hello' },
});
await PageObjects.settings.createIndexPattern('index-*,-index-b');
});
it('data view creation with exclusion', async () => {
const fieldCount = await PageObjects.settings.getFieldsTabCount();
// five metafields plus keyword and text version of 'user' field
expect(parseInt(fieldCount, 10)).to.be(6);
});
after(async () => {
await es.transport.request({
path: '/index-a',
method: 'DELETE',
});
await es.transport.request({
path: '/index-b',
method: 'DELETE',
});
await PageObjects.settings.removeIndexPattern();
await security.testUser.restoreDefaults();
});
});
}

View file

@ -249,6 +249,36 @@ export default async function ({ readConfigFile }) {
kibana: [],
},
index_a: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['index-a'],
privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},
index_b: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['index-b'],
privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},
kibana_sample_read: {
elasticsearch: {
cluster: [],