Skip to content

Commit

Permalink
Migrated ILM Tests to Use test_user (#121262) (#121359)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
kibanamachine and John Dorlus authored Dec 16, 2021
1 parent a43143a commit e8bf5e4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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 () => {
Expand Down
8 changes: 8 additions & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@ export default async function ({ readConfigFile }) {
elasticsearch: {
cluster: ['manage_ilm'],
},
kibana: [
{
feature: {
advancedSettings: ['read'],
},
spaces: ['default'],
},
],
},

index_management_user: {
Expand Down

0 comments on commit e8bf5e4

Please sign in to comment.