You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--splunk-forwarder-host=<splunk_forwarder_host># Splunk instance where forwarding to receiver instance is configured.
217
+
--splunk-hec-port=<splunk_forwarder_hec_port># HEC port of the forwarder instance.
218
+
--splunk-hec-token=<splunk_forwarder_hec_token># HEC token configured in forwarder instance.
219
+
--splunk-data-generator=<pytest_splunk_addon_conf_path># Path to pytest-splunk-addon-data.conf
221
220
```
222
221
223
222
> **_NOTE:_**
@@ -243,10 +242,10 @@ There are 3 types of tests included in pytest-splunk-addon are:
243
242
3. To generate test cases only for index time properties, append the following marker to pytest command:
244
243
245
244
```console
246
-
-m splunk_indextime --splunk-data-generator=<Path to the conf file
245
+
-m splunk_indextime --splunk-data-generator=<Path to the conf file>
247
246
```
248
247
249
-
For detailed information on index time test execution, please refer {ref}`here <index_time_tests`.
248
+
For detailed information on index time test execution, please refer [here](./index_time_tests.md).
250
249
251
250
- To execute all the searchtime tests together, i.e both Knowledge objects and CIM compatibility tests,
252
251
append the following marker to the pytest command:
@@ -262,19 +261,19 @@ The following optional arguments are available to modify the default settings in
262
261
1. To search for events in a specific index, user can provide following additional arguments:
263
262
264
263
```console
265
-
--search-index=<index
264
+
--search-index=<index>
266
265
267
266
Splunk index of which the events will be searched while testing. Default value: "*, _internal".
268
267
```
269
268
270
269
2. To increase/decrease time interval and retries for flaky tests, user can provide following additional arguments:
271
270
272
271
```console
273
-
--search-retry=<retry
272
+
--search-retry=<retry>
274
273
275
274
Number of retries to make if there are no events found while searching in the Splunk instance. Default value: 0.
276
275
277
-
--search-interval=<interval
276
+
--search-interval=<interval>
278
277
279
278
Time interval to wait before retrying the search query.Default value: 0.
280
279
```
@@ -297,7 +296,7 @@ The following optional arguments are available to modify the default settings in
297
296
- **Addon related errors:** To suppress these user can create a file with the list of strings and provide the file in the **--ignore-addon-errors** param while test execution.
298
297
299
298
```console
300
-
--ignore-addon-errors=<path_to_file
299
+
--ignore-addon-errors=<path_to_file>
301
300
```
302
301
303
302
- Sample strings in the file.
@@ -328,7 +327,7 @@ The following optional arguments are available to modify the default settings in
328
327
- Default value for this parameter is *store_new*
329
328
330
329
```console
331
-
--event-file-path=<path_to_file
330
+
--event-file-path=<path_to_file>
332
331
```
333
332
334
333
- Path to tokenized events file
@@ -380,7 +379,7 @@ The following optional arguments are available to modify the default settings in
380
379
381
380
**3. Setup test environment before executing the test cases**
382
381
383
-
If any setup is required in the Splunk/test environment before executing the test cases, implement a fixture in {ref}`conftest.py <conftest_file`.
382
+
If any setup is required in the Splunk/test environment before executing the test cases, implement a fixture in [conftest.py](#conftest).
To generate test cases only for index time properties, append the following marker to pytest command:
23
23
24
24
```console
25
-
-m splunk_indextime --splunk-data-generator=<Path to the conf file
25
+
-m splunk_indextime --splunk-data-generator=<Path to the conf file>
26
26
```
27
27
28
28
> **_NOTE:_** --splunk-data-generator should contain the path to *pytest-splunk-addon-data.conf*,
@@ -55,7 +55,7 @@ To generate test cases only for index time properties, append the following mark
55
55
- This test case will not be generated if there are no key fields specified for the event.
56
56
- Key field can be assign to token using field property. `i.e token.n.field = <KEY_FIELD>`
57
57
58
-
Testcase assertions:
58
+
####Testcase Assertions:
59
59
60
60
- There should be at least 1 event with the sourcetype and host.
61
61
- The values of the key fields obtained from the event
@@ -72,7 +72,7 @@ To generate test cases only for index time properties, append the following mark
72
72
73
73
- Execute the SPL query in a Splunk instance.
74
74
75
-
- Assert the test case results as mentioned in {ref}`testcase assertions<test_assertions_key_field`.
75
+
- Assert the test case results as mentioned in [testcase assertions](#testcase-assertions).
76
76
77
77
**2. Test case for _time property:**
78
78
@@ -141,8 +141,8 @@ If all the above conditions are satisfied, further analysis of the test is requi
141
141
For every test case failure, there is a defined structure for the stack trace.
142
142
143
143
```text
144
-
AssertionError: <<error_message
145
-
Search = <Query
144
+
AssertionError: <<error_message>>
145
+
Search = <Query>
146
146
```
147
147
148
148
Get the search query from the stack trace and execute it on the Splunk instance and verify which specific type of events are causing failure.
@@ -229,9 +229,9 @@ Get the search query from the stack trace and execute it on the Splunk instance
229
229
230
230
- No test would generate to test Key Fields for that particular stanza and thus won't be correctly tested.
231
231
232
-
8. When do I assign token.\<n.field = \<field_name to test the Key Fields for an event?
232
+
8. When do I assign token.<n>.field = <field_name> to test the Key Fields for an event?
233
233
234
-
- When there props configurations written in props to extract any of the field present in Key Fields list, you should add `token.<n.field = <field_name` to the token for that field value.
234
+
- When there props configurations written in props to extract any of the field present in Key Fields list, you should add `token.<n>.field = <field_name>` to the token for that field value.
235
235
- Example:
236
236
: For this sample, there is report written in props that extracts `127.0.0.1` as `src`,
0 commit comments