-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 4659 events tests #648
Conversation
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
tests/integration/test_fim/test_basic_usage/test_basic_usage_deferred_delete_folder.py
Outdated
Show resolved
Hide resolved
Fix some styling problems on test_basic_usage_deferred_delete_folder.py to comply with the stablished guidelines.
a353fbd
to
08e2c49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ, but some changes are required
# configurations | ||
|
||
conf_params = {'TEST_DIRECTORIES': directory_str, 'MODULE_NAME': __name__} | ||
p, m = generate_params(extra_params=conf_params, modes=['whodata']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables with a single letter are not allowed, they should have descriptive names as parameters
and metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
# callback | ||
def callback_detect_delete_event(line): | ||
msg = r'.*Sending FIM event: (.+)$' | ||
match = re.match(msg, line) | ||
|
||
try: | ||
event = json.loads(match.group(1)) | ||
if (event['type'] == 'event' and | ||
event['data']['type'] == 'deleted' and | ||
'process_name' not in event['data']['audit']): | ||
return event | ||
except (AttributeError, JSONDecodeError, KeyError): | ||
pass | ||
|
||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A callback is a generic function, it should be placed in a common library as fim.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
confirmation = re.search(r'\((\w)\/\w\)\?', stdout[0]) | ||
assert confirmation | ||
|
||
# Run the command again and this time delete the files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this time delete the files
, we could comment confirm deletion of files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Fix some styling problems on test_basic_usage_deferred_delete_folder.py to comply with the stablished guidelines.
This PR is outdated, we work with this in a temporal branch I attached some details about the package used and executions. Package Details
The test execution results are:
|
…. Some style changes
dba293e
to
61fd31d
Compare
After analyzing the problem, I have found that it is no longer necessary to check in this test that the process_name field does not appear, since the fix that has been given to this bug has finally been different from what was thought at first. |
Packages details
local_internal_options.confAgent
|
Packages details
local_internal_options.confAgent Windows
Agent Centos, macos, solaris
Manager
Test Results
|
Try not to use hardcoded |
Description
The added tests verify that Windows events with ID 4659 generate deleted events correctly.
In order to test this condition, the tests create a number of files and later deletes them by using the Windows
del
command interactively.Results