Migrated ILM Tests to Use test_user (#121262) (#121359)

* Updated ILM tests to use test user and updated permissions.

* Updated security tests to check for Advanced Settings in the navigatio pane since we added it to the Kibana permissions.

Co-authored-by: John Dorlus <silne.dorlus@elastic.co>
This commit is contained in:
Kibana Machine 2021-12-15 19:18:14 -05:00 committed by GitHub
parent a43143a1df
commit e8bf5e4322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -60,7 +60,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
it('should render the "Data" section with ILM', async () => {
await PageObjects.common.navigateToApp('management');
const sections = await managementMenu.getSections();
expect(sections).to.have.length(1);
// Changed sections to have a length of 2 because of
// https://github.com/elastic/kibana/pull/121262
expect(sections).to.have.length(2);
expect(sections[0]).to.eql({
sectionId: 'data',
sectionLinks: ['index_lifecycle_management'],

View file

@ -16,9 +16,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const log = getService('log');
const retry = getService('retry');
const esClient = getService('es');
const security = getService('security');
describe('Home page', function () {
before(async () => {
await security.testUser.setRoles(['manage_ilm'], true);
await esClient.snapshot.createRepository({
name: repoName,
body: {
@ -30,11 +32,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
},
verify: false,
});
await pageObjects.common.navigateToApp('indexLifecycleManagement');
});
after(async () => {
await esClient.snapshot.deleteRepository({ name: repoName });
await esClient.ilm.deleteLifecycle({ name: policyName });
await security.testUser.restoreDefaults();
});
it('Loads the app', async () => {

View file

@ -516,6 +516,14 @@ export default async function ({ readConfigFile }) {
elasticsearch: {
cluster: ['manage_ilm'],
},
kibana: [
{
feature: {
advancedSettings: ['read'],
},
spaces: ['default'],
},
],
},
index_management_user: {