[ILM] Fixed failed functional tests on Cloud (#123202)

* [ILM] Fixed functional test failures on Cloud

* [Upgrade Assistant] Fixed functional test failures on Cloud
This commit is contained in:
Yulia Čech 2022-01-18 14:10:38 +01:00 committed by GitHub
parent e721b2b8bc
commit a62a6f36b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
const policyName = 'testPolicy1';
const repoName = 'test';
const repoName = 'found-snapshots'; // this repo already exists on cloud
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['common', 'indexLifecycleManagement']);
@ -17,26 +17,33 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const retry = getService('retry');
const esClient = getService('es');
const security = getService('security');
const deployment = getService('deployment');
describe('Home page', function () {
before(async () => {
await security.testUser.setRoles(['manage_ilm'], true);
await esClient.snapshot.createRepository({
name: repoName,
body: {
type: 'fs',
settings: {
// use one of the values defined in path.repo in test/functional/config.js
location: '/tmp/',
const isCloud = await deployment.isCloud();
if (!isCloud) {
await esClient.snapshot.createRepository({
name: repoName,
body: {
type: 'fs',
settings: {
// use one of the values defined in path.repo in test/functional/config.js
location: '/tmp/',
},
},
},
verify: false,
});
verify: false,
});
}
await pageObjects.common.navigateToApp('indexLifecycleManagement');
});
after(async () => {
await esClient.snapshot.deleteRepository({ name: repoName });
const isCloud = await deployment.isCloud();
if (!isCloud) {
await esClient.snapshot.deleteRepository({ name: repoName });
}
await esClient.ilm.deleteLifecycle({ name: policyName });
await security.testUser.restoreDefaults();
});