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

Add additional test checks #216

Closed
wants to merge 1 commit into from
Closed

Add additional test checks #216

wants to merge 1 commit into from

Conversation

thrix
Copy link
Collaborator

@thrix thrix commented Apr 21, 2020

This PR introduces additional test checks that make sense
to run while runing the tests.

The checks are by default controlled on the test level,
but can be overridden in plans.

Signed-off-by: Miroslav Vadkerti [email protected]

@t184256
Copy link
Contributor

t184256 commented Apr 21, 2020

I feel like AVC and test-inspector represent two distinct classes of checks, actually. Checking for AVCs is a property of the test, and the decision to either do that manually or default to making the execution environment do that relies on the test itself. test-inspector is more of a runtime choice. I mean, yeah, enabling this in the test can mean "it's checked to be non-destructive and I don't want to regress on that", but I'd say we need a way to enable-disable checks at runtime too.

@thrix
Copy link
Collaborator Author

thrix commented Apr 21, 2020

I feel like AVC and test-inspector represent two distinct classes of checks, actually. Checking for AVCs is a property of the test, and the decision to either do that manually or default to making the execution environment do that relies on the test itself. test-inspector is more of a runtime choice. I mean, yeah, enabling this in the test can mean "it's checked to be non-destructive and I don't want to regress on that", but I'd say we need a way to enable-disable checks at runtime too.

hmm I wonder, isn't that runtime disabling then more a details of the check itself? is it something we need to care here?

@thrix thrix changed the title Add additionalk test checks Add additional test checks Apr 21, 2020
@t184256
Copy link
Contributor

t184256 commented Apr 21, 2020

I hope we'll be fine with non-parametrized checks and boolean enable/disable for a long time.

Copy link
Contributor

@t184256 t184256 left a comment

Choose a reason for hiding this comment

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

Looks fine, would benefit from a command-line override example.

@psss
Copy link
Collaborator

psss commented Apr 22, 2020

I am not completely sure about the granularity. Is it really necessary to track check per individual test case? Especially for the test-inspector this does not make sense to me. I'd say you either want to enable it for the whole plan or completely disable.

@milosmalik, what should be the granularity for the AVC check opt-out feature for your use case? Would it be enough to enable/disable the AVC check for the whole set of tests selected in a plan (L2 metadata) or would it be useful to be able to enable/disable checks per individual test case (L1 metadata)?

@milosmalik
Copy link

This option is ideal for our purposes:

  • enable/disable AVC checks per individual test case (L1 metadata)

The following option is too broad for our purposes:

  • enable/disable the AVC check for the whole set of tests selected in a plan (L2 metadata)

@thrix
Copy link
Collaborator Author

thrix commented Apr 22, 2020

@psss ok seems so we need it in L1, at least for avc

@psss
Copy link
Collaborator

psss commented Apr 27, 2020

I see, thanks for the feedback, @milosmalik. So it seems for the selinux team there would have to be a new L1 attribute. Just want to make sure we do not introduce a new field for a single team and for a single check: Are there any other check examples to support the use case? Are there other teams or components for which it would make sense to enable additional checks per test case?

@kkaarreell
Copy link
Collaborator

I would argue for a different word with more clear semantics. 'check' sounds too unclear to me.
I don't have truly better proposal though. :-( runtime_test, runtime_subtest, runtime_check? No idea.

@thrix
Copy link
Collaborator Author

thrix commented Apr 28, 2020

So after discussion, seems we will drop this idea because:

  1. there is not other example here than 'avc' ...

  2. keep it similar to what we have now in downstream, control 'avc' via an environment variable

--taskparam='AVC_ERROR=+no_avc_check'

@psss
Copy link
Collaborator

psss commented Apr 28, 2020

I would wait a bit, just to make sure more similar use cases do not pop up from other team members.

@martinky82
Copy link

Hi, introducing ABRT check would be nice, too. It could work simply by checking, if there's anyting present in /var/spool/abrt and/or by grepping specific patterns in syslog (journal, /var/log/messages) and fail if there's anything found. For proper functionality it would of course need to have ABRT up and running, but since it is preferrable to run jobs with --abrt to have crashes reported to QE FAF, should an arise, it shouldn't be a problem. If ABRT is not installed, the check would do nothing and simply pass.

@thrix
Copy link
Collaborator Author

thrix commented May 19, 2020

Hi, introducing ABRT check would be nice, too. It could work simply by checking, if there's anyting present in /var/spool/abrt and/or by grepping specific patterns in syslog (journal, /var/log/messages) and fail if there's anything found. For proper functionality it would of course need to have ABRT up and running, but since it is preferable to run jobs with --abrt to have crashes reported to QE FAF, should an arise, it shouldn't be a problem. If ABRT is not installed, the check would do nothing and simply pass.

@martinky82 --abrt where? if we would use the same approach in TMT/FMF world, we would need to explicitly enable and start abrt in prepare phase preferably. Maybe abrt check then could be part of report phase instead @psss ?

@martinky82
Copy link

@martinky82 --abrt where? if we would use the same approach in TMT/FMF world, we would need to explicitly enable and start abrt in prepare phase preferably. Maybe abrt check then could be part of report phase instead @psss ?

In wow command line. What it does is that it puts enable-abrt task at the beginning and check-abrt task at the end of a job (enable-abrt being much more important in our workflow).

@martinky82
Copy link

Here's how it works:

  1. enable-abrt changes abrt configuration and starts abrtd + friends (this could be done in prepare phase)
  2. every crash gets reported to FAF server immediately
  3. check-abrt in the end checks if there is anything in /var/spool/abrt and does rlPass / rlFail accordingly (this could be done in report phase).

@psss psss added this to the 2.0 milestone Mar 2, 2021
@thrix thrix requested a review from FrNecas as a code owner July 28, 2022 16:35
@psss
Copy link
Collaborator

psss commented Oct 4, 2022

This has been stalled for too long. I believe this will need some more discussion before moving forward. Also the proposed key name checks should be singular to be consistent with other test keys and the content seems much more naturally to be a list rather then a string. Resetting the reviews and marking for discussion.

@packit-as-a-service
Copy link

Failed to load packit config file:

Cannot parse package config: ValidationError({'jobs': {0: {'current_version_command': ['Unknown field.']}}, 'current_version_command': ['Unknown field.']}).

For more info, please check out the documentation or contact the Packit team.

@psss psss added specification Metadata specification (core, tests, plans, stories) command | tests tmt tests command labels Oct 4, 2022
spec/tests/checks.fmf Outdated Show resolved Hide resolved
spec/tests/checks.fmf Outdated Show resolved Hide resolved
@happz
Copy link
Collaborator

happz commented Oct 4, 2022

Other related issues that appeared over time: #1235 #1523 #1464

@packit-as-a-service
Copy link

Failed to load packit config file:

Cannot parse package config: ValidationError({'jobs': {0: {'current_version_command': ['Unknown field.']}}, 'current_version_command': ['Unknown field.']}).

For more info, please check out the documentation or contact the Packit team.

@thrix thrix self-assigned this Oct 4, 2022
@thrix thrix force-pushed the rfe-introduce-checks branch 2 times, most recently from 9485aad to 18f6995 Compare October 4, 2022 16:29
@thrix thrix requested review from psss and removed request for t184256 October 4, 2022 16:34
@thrix
Copy link
Collaborator Author

thrix commented Oct 4, 2022

@happz @psss I updated it to the latest code, and left out avc as the default check. I believe the default AVC check enabled should be part of the planned profile, rather than a global default.

I am, although, SUPER confused why validation does not fail here :(

@kkaarreell
Copy link
Collaborator

Where is the actual AVC chech implemented? I do not see such a code in this PR.

@psss
Copy link
Collaborator

psss commented Oct 7, 2022

This was just a kick-off of the specification.

Add additional checks definition to the spec files and extend
the jsonschema with them.

Signed-off-by: Miroslav Vadkerti <[email protected]>
@Koncpa
Copy link

Koncpa commented Nov 9, 2022

After yesterday's discussion, we agreed that the proposed solution should be more generic and a framework should be created in tmt where the user can use a prepared module or add their own to check various information on the system (AVC, out-of-memory, kernel-panic, logs) .

Probably check will be applied after every test, but was also proposed check after each beakerLib phase or after run of the whole test plan.

results for the plan run. It has the same values as
``TEST_RESULT``. Plan result is counted according to the
``TEST_OUTCOME``. Plan result is counted according to the
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure how changes in this file are related to adding the check L1 key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure now, feel free to drop it @happz

@happz
Copy link
Collaborator

happz commented Jan 30, 2023

I'd start hacking on this because it's a feature we'd have use for in downstream, but I'd rather wait till #1679 gets resolved & its components merged. Supporting custom checks, together with custom export plugins, sounds like we do need to generalize plugin loading a bit - it was handling step plugins only until very recently, here already a possible third type of plugin spawned, let's make it a cleaner and less step-ish. I can imagine having a shell-like plugin, making decisions based on a script exit code as well as a plugin built out of hundreds of Python lines, and these need to register somehow, just like step and now the export plugins do.

@thrix
Copy link
Collaborator Author

thrix commented Feb 22, 2023

@happz thanks, I changed the assignee to you

@martinhoyer
Copy link
Collaborator

Can I somehow help to move this forward?
Have there been any discussions about the subject since February, apart from in #1875 ?

@happz
Copy link
Collaborator

happz commented Jul 10, 2023

Can I somehow help to move this forward?

If there’s a tmt meeting tomorrow and you’d be able to join, please, remind the developers of the discussion mentioned below.

Have there been any discussions about the subject since February, apart from in #1875 ?

None that I know if. I’m waiting for literally anyone to comment and help me address the blank spots.

@psss
Copy link
Collaborator

psss commented Sep 11, 2023

@happz, I guess this one has been obsoleted by #2210, right?

@happz
Copy link
Collaborator

happz commented Sep 14, 2023

@happz, I guess this one has been obsoleted by #2210, right?

@psss I think so, yes. There are few lines here and there #2210 does not add, namely the plan-level checks, but I avoided those on purpose. I will raise the topic of plan-level test checks in the #1875, and file issues as needed.

@happz happz closed this Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command | tests tmt tests command specification Metadata specification (core, tests, plans, stories) status | discuss Needs more discussion before closing
Projects
None yet
Development

Successfully merging this pull request may close these issues.