Allow changing specific `check` if others have been configured by default
When multiple checks are configured in the main root file, it is not possible in the test level to change the configuration of one of them.
example:
main.fmf on repo root:
check:
- how: avc
- how: dmesg
failure-pattern:
# These are default patterns
- 'Call Trace:'
- how: watchdog
adjust:
- when: check-result == info
check:
- how: avc
result: info
- how: dmesg
result: info
failure-pattern:
# These are default patterns
- 'Call Trace:'
- how: watchdog
result: info
- when: check-result == disabled
check:
- how: avc
enabled: false
- how: dmesg
enabled: false
- how: watchdog
enabled: false
on test metadata add:
check+:
- how: avc
enabled: false
Currently this happens:
tmt test show <test>
the check is added as an additional one, that leaves 2 avc checks, one enabled and other disabled
check - how: avc
enabled: false
result: respect
- how: avc
enabled: true
result: respect
tmt -c check-result=info test show <test>
the check defined in the test level is not being set when setting a context that adjust the check.
check - how: avc
enabled: true
result: info
more details about the usage: https://gitlab.com/cki-project/infrastructure/-/issues/517 and https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/merge_requests/3774
Would be good to resolve together with #3538 as the global check config functionality is related.
As the first step, the implementation will be outlined in:
- https://github.com/teemtee/tmt/issues/3692
Done, there is now a specification piece describing the tmt run profiles. One of the example shows how to add a check only when it's not defined, and the mechanism offers enough tools to change a check if it exists. I would consider to be done as soon as the specification PR, https://github.com/teemtee/tmt/pull/3771, lands in main.