Skip to content
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

cleanup(tests): remove wrong/unused assert. #66

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Dec 2, 2024

falcosecurity/libs#2165 exposed a bug in the TestFalco_Legacy_FalcoEventGenerator test.
Previous code was storing full user/group info in threadinfo; before parsers understood that container_id was changed (ie: we entered a container), set_{user,group} was called (eg here: https://github.com/falcosecurity/libs/blob/master/userspace/libsinsp/parsers.cpp#L1769), storing in the threadinfo user and group information related to uid and gid for the host. Then, when refreshing info for the container(https://github.com/falcosecurity/libs/blob/master/userspace/libsinsp/parsers.cpp#L1843), since the container data cannot be loaded while replaying a scap file, and since the scap file itself does not container useradded events (being too old), we did not overwrite existing user/group info stored in the threadinfo.
Therefore the threadinfo was returning user and group releted info mapped to the host while being on a container.

The new code fixed that behavior but then the test fails. Since we have no way to retrieve the correctly mapped-to-the-container user and group info while replaying a scap file that has no useradded events, we can only remove the assert.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 2, 2024

/hold
will try to fix the ci too.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP FedeDP force-pushed the remove_useless_asser branch from 8605ecc to a4af8b6 Compare December 2, 2024 16:25
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link

poiana commented Dec 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Dec 2, 2024
@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 2, 2024

/unhold

@poiana poiana merged commit de697c1 into falcosecurity:main Dec 2, 2024
3 checks passed
@Andreagit97
Copy link
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants