Skip to content

Commit f6cdc52

Browse files
committed
implement export prebuilt rules test plan
1 parent f317cec commit f6cdc52

23 files changed

Lines changed: 1056 additions & 672 deletions

File tree

x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Test plan: exporting prebuilt rules <!-- omit from toc -->
22

3-
**Status**: `in progress`, matches [Milestone 3](https://github.com/elastic/kibana/issues/174168).
3+
**Status**: `implemented`, matches [Milestone 3](https://github.com/elastic/kibana/issues/174168).
44

55
> [!TIP]
66
> If you're new to prebuilt rules, get started [here](./prebuilt_rules.md) and check an overview of the features of prebuilt rules in [this section](./prebuilt_rules_common_info.md#features).
@@ -40,6 +40,7 @@ https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
4040
- [**Scenario: Exporting a prebuilt rule from rules management table**](#scenario-exporting-a-prebuilt-rule-from-rules-management-table)
4141
- [**Scenario: Exporting multiple prebuilt rules in bulk**](#scenario-exporting-multiple-prebuilt-rules-in-bulk)
4242
- [**Scenario: Exporting a mix of prebuilt and custom rules in bulk**](#scenario-exporting-a-mix-of-prebuilt-and-custom-rules-in-bulk)
43+
- [**Scenario: Importing a mix of just bulk exported prebuilt and custom rules**](#scenario-importing-a-mix-of-just-bulk-exported-prebuilt-and-custom-rules)
4344
- [Error Handling](#error-handling)
4445
- [**Scenario: Exporting beyond the export limit**](#scenario-exporting-beyond-the-export-limit)
4546

@@ -177,10 +178,28 @@ And the exported custom rules should include an "immutable" field having false v
177178
And the exported custom rules "rule_source.type" should be "internal"
178179
```
179180

181+
#### **Scenario: Importing a mix of just bulk exported prebuilt and custom rules**
182+
183+
**Automation**: 1 integration test and 1 cypress test.
184+
185+
```Gherkin
186+
Given a mix of customized prebuilt, non-customized prebuilt and custom rules
187+
When user selects some rules of each type in the rule management table
188+
And bulk exports them
189+
Then the selected rules should be exported as an NDJSON file
190+
When user removes the rules and imports just exported NDJSON file
191+
Then the rules should be created
192+
And the created rules should be correctly identified as prebuilt or custom
193+
And the created rules' is_customized field should be correctly calculated
194+
And the created rules' parameters should match the import payload
195+
```
196+
180197
### Error Handling
181198

182199
#### **Scenario: Exporting beyond the export limit**
183200

201+
**Automation**: 2 integration tests and 1 cypress test.
202+
184203
```Gherkin
185204
Given prebuilt and custom rules
186205
And the number of rules is greater than the export limit (defaults to 10_000)

x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import path from 'path';
1010

1111
const SECURITY_DETECTION_ENGINE_PACKAGES_PATH = path.join(
1212
path.dirname(__filename),
13-
'../import/fixtures/packages'
13+
'../import_export/fixtures/packages'
1414
);
1515

1616
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
@@ -20,7 +20,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
2020

2121
return {
2222
...functionalConfig.getAll(),
23-
testFiles: [require.resolve('../import/import_with_installing_package')],
23+
testFiles: [require.resolve('../import_export/import_with_installing_package')],
2424
kbnTestServer: {
2525
...functionalConfig.get('kbnTestServer'),
2626
serverArgs: [

0 commit comments

Comments
 (0)