Skip to content

Commit

Permalink
Merge pull request #1000 from wazuh/5252-added-cases-to-ignore
Browse files Browse the repository at this point in the history
Added some cases in test_ignore_valid, to check entire disk ignore
  • Loading branch information
vikman90 authored Feb 1, 2021
2 parents d7996c9 + 6bfd6fc commit a43b673
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,20 @@
attributes:
- check_all: 'yes'
- FIM_MODE
# conf 12
- tags:
- ignore_disk
apply_to_modules:
- test_ignore_valid
sections:
- section: syscheck
elements:
- disabled:
value: 'no'
- directories:
value: "/testdir1,/testdir2"
attributes:
- check_all: 'yes'
- FIM_MODE
- ignore:
value: "/"
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,20 @@
attributes:
- check_all: 'yes'
- FIM_MODE
# conf 12
- tags:
- ignore_disk
apply_to_modules:
- test_ignore_valid
sections:
- section: syscheck
elements:
- disabled:
value: 'no'
- directories:
value: "c:\\testdir1,c:\\testdir2"
attributes:
- check_all: 'yes'
- FIM_MODE
- ignore:
value: "c:\\."
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def get_configuration(request):
(testdir1, 'mytest', "test", True, {'negation_regex'}),
(testdir1, 'othername', "test", False, {'negation_regex'}),
(testdir1, 'file1', "test", False, {'incomplete_regex'}),
(testdir1_ignore_folder, 'file2', "test", False, {'incomplete_regex'})
(testdir1_ignore_folder, 'file2', "test", False, {'incomplete_regex'}),
(testdir1, 'file1', "test", False, {'ignore_disk'})
])
def test_ignore_subdirectory(folder, filename, content, triggers_event,
tags_to_apply, get_configuration,
Expand Down Expand Up @@ -114,8 +115,8 @@ def test_ignore_subdirectory(folder, filename, content, triggers_event,
callback=callback_detect_event,
error_message='Did not receive expected '
'"Sending FIM event: ..." event').result()
assert event['data']['type'] == 'added', f'Event type not equal'
assert event['data']['path'] == os.path.join(folder, filename), f'Event path not equal'
assert event['data']['type'] == 'added', 'Event type not equal'
assert event['data']['path'] == os.path.join(folder, filename), 'Event path not equal'
else:
while True:
ignored_file = wazuh_log_monitor.start(timeout=global_parameters.default_timeout * 2,
Expand Down

0 comments on commit a43b673

Please sign in to comment.