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

RFE: support for SCMP_FLTATR_CTL_OPTIMIZE, SCMP_FLTATR_API_SYSRAWRC #75

Closed
wants to merge 4 commits into from

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Sep 18, 2021

  1. Test fixups.

    Those are fixups in test case used by the following commits.
    Let me know if you want a separate PR for that (first two commits).

  2. Add support for SCMP_FLTATR_CTL_OPTIMIZE

    Introduce (*ScmpFilter).GetOptimize and (*ScmpFilter).SetOptimize
    methods, together with the documentation and trivial tests.

  3. Add support for SCMP_FLTATR_API_SYSRAWRC

    Introduce (*ScmpFilter).GetRawRC and (*ScmpFilter).SetRawRC
    methods, together with the documentation and trivial tests.

Addresses: #37

@kolyshkin kolyshkin changed the title Opt RFE: support for SCMP_FLTATR_CTL_OPTIMIZE, SCMP_FLTATR_API_SYSRAWRC Sep 18, 2021
@kolyshkin kolyshkin marked this pull request as draft September 18, 2021 19:50
@kolyshkin kolyshkin force-pushed the opt branch 3 times, most recently from 3bec561 to 94d13ad Compare September 19, 2021 22:48
@kolyshkin
Copy link
Contributor Author

Commit 23edf06 moved the SetBadArchAction(ActInvalid) check
to the end of TestFilterAttributeGettersAndSetters. A few subsequent
commits added more code before it, until finally commit 541420d
added a conditional t.Skipf before it.

As a result, this check is not performed with latest libseccomp.

Move it back to where it belongs (before the API/version checks).

Signed-off-by: Kir Kolyshkin <[email protected]>
1. Use checkAPI to check for minimal API level and libseccomp version
   requirements.

2. TestFilterAttributeGettersAndSetters tests multiple things, requiring
   different API levels and libseccomp versions. It should not use t.Skip
   in the middle of the test, since the end result is going to be "SKIP"
   instead of "PASS". In the middle of the test, use return to skip the
   part of the test.

3. While at it, don't use t.Logf/t.Errorf if there are no %-style
   arguments.

Signed-off-by: Kir Kolyshkin <[email protected]>
Introduce (*ScmpFilter).GetOptimize and (*ScmpFilter).SetOptimize
methods, together with the documentation and trivial tests.

Signed-off-by: Kir Kolyshkin <[email protected]>
Introduce (*ScmpFilter).GetRawRC and (*ScmpFilter).SetRawRC
methods, together with the documentation and trivial tests.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin marked this pull request as ready for review October 13, 2021 18:07
@kolyshkin
Copy link
Contributor Author

No longer a draft

Copy link
Member

@pcmoore pcmoore left a comment

Choose a reason for hiding this comment

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

Looks good to me, @drakenclimber ?

Acked-by: Paul Moore <[email protected]>

@pcmoore pcmoore requested a review from drakenclimber October 28, 2021 22:45
Copy link
Member

@drakenclimber drakenclimber left a comment

Choose a reason for hiding this comment

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

Looks good to me, @kolyshkin. Thanks.

Acked-by: Tom Hromatka <[email protected]>

@pcmoore
Copy link
Member

pcmoore commented Dec 27, 2021

Merged at HEAD 460967f, thanks!

@pcmoore pcmoore closed this Dec 27, 2021
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