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

new(libsinsp/test): Start dedicated container engine unit testsuite w/ mock CRI API response #1544

Merged
merged 9 commits into from
Dec 13, 2023

Conversation

incertum
Copy link
Contributor

@incertum incertum commented Dec 4, 2023

What type of PR is this?

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

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

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

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/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:

  • Mock container runtime socket API responses for both container and pod in the containerd CRI scenario,
    thereby enabling us to test the parser logic.
  • Test container engine cache lifecycle management

While we need realistic e2e tests, this will help especially since we are starting to realize that the container engine needs some refactoring. Note that this is a start given the current limitations.
If the other maintainers support this general approach we can continue working on it.

Related to #1298

CC @Andreagit97 and @therealbobo

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

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.

I like the idea thank you for this! Just left some possible suggestions

incertum and others added 9 commits December 12, 2023 20:14
… test

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
…ri parsers

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
…els handling

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
@@ -16,6 +16,11 @@ limitations under the License.

*/

#pragma once

#ifndef LIBSINSP_CRI_HPP
Copy link
Member

Choose a reason for hiding this comment

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

if we use the #pragma once we don't need the header guard #ifndef LIBSINSP_CRI_HPP

@poiana
Copy link
Contributor

poiana commented Dec 13, 2023

LGTM label has been added.

Git tree hash: 823bb57306f9610bfbbc9b8ba1f1cf9fb9e12241

Copy link
Contributor

@FedeDP FedeDP 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
Contributor

poiana commented Dec 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [Andreagit97,FedeDP,incertum]

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

@poiana poiana merged commit 0672305 into falcosecurity:master Dec 13, 2023
26 checks passed
@incertum incertum deleted the new-container-unit-testsuite branch December 13, 2023 21:54
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.

5 participants