libs icon indicating copy to clipboard operation
libs copied to clipboard

new(libsinsp/test): add basic tests for networking and container events

Open LucaGuerra opened this issue 3 years ago • 4 comments

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

These new tests exercise simple cases of ipv4/ipv6 connections (which we all know can have many weird corner cases), including some highlighted here: https://github.com/falcosecurity/libs/issues/260 , plus container metadata parsing through container events.

More importantly, I think, convenience functions to deal with sockaddr have been added, so that people that need to add more tests don't need to figure out the scap format for connections.

This brings libsinsp coverage from ~19% to ~23%~ ~24%

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

LucaGuerra avatar Sep 21 '22 15:09 LucaGuerra

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LucaGuerra

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 avatar Sep 21 '22 15:09 poiana

Interesting, this fails with a minimal build, will investigate.

LucaGuerra avatar Sep 21 '22 16:09 LucaGuerra

/milestone 0.10.0

But this can be moved to 0.9.0 as it adds tests, IMHO.

FedeDP avatar Sep 22 '22 09:09 FedeDP

This should be rebased :)

Andreagit97 avatar Oct 13 '22 07:10 Andreagit97

Will be reopening this now, with 50% more refactoring and rebasing

LucaGuerra avatar Nov 07 '22 12:11 LucaGuerra