-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathenrollment_flow.config.ts
54 lines (44 loc) · 1.83 KB
/
enrollment_flow.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import fs from 'fs/promises';
import { join, resolve } from 'path';
import type { FtrConfigProviderContext } from '@kbn/test';
import { getDataPath } from '@kbn/utils';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const manualConfigurationFlowTestsConfig = await readConfigFile(
require.resolve('./manual_configuration_flow.config.ts')
);
const tempKibanaYamlFile = join(getDataPath(), `interactive_setup_kibana_${Date.now()}.yml`);
await fs.writeFile(tempKibanaYamlFile, '');
const caPath = resolve(__dirname, './fixtures/elasticsearch.p12');
return {
...manualConfigurationFlowTestsConfig.getAll(),
testFiles: [require.resolve('./tests/enrollment_flow')],
junit: {
reportName: 'Interactive Setup API Integration Tests (Enrollment flow)',
},
esTestCluster: {
...manualConfigurationFlowTestsConfig.get('esTestCluster'),
serverArgs: [
...manualConfigurationFlowTestsConfig.get('esTestCluster.serverArgs'),
'xpack.security.enrollment.enabled=true',
`xpack.security.http.ssl.keystore.path=${caPath}`,
'xpack.security.http.ssl.keystore.password=storepass',
],
},
kbnTestServer: {
...manualConfigurationFlowTestsConfig.get('kbnTestServer'),
serverArgs: [
...manualConfigurationFlowTestsConfig
.get('kbnTestServer.serverArgs')
.filter((arg: string) => !arg.startsWith('--config')),
`--config=${tempKibanaYamlFile}`,
],
},
};
}