tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Allow changing specific `check` if others have been configured by default

Open bgoncalv opened this issue 1 year ago • 3 comments

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

bgoncalv avatar Mar 18 '25 13:03 bgoncalv

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

bgoncalv avatar Mar 18 '25 14:03 bgoncalv

Would be good to resolve together with #3538 as the global check config functionality is related.

psss avatar Mar 19 '25 09:03 psss

As the first step, the implementation will be outlined in:

  • https://github.com/teemtee/tmt/issues/3692

psss avatar Apr 23 '25 13:04 psss

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.

happz avatar May 26 '25 08:05 happz

I would consider to be done as soon as the specification PR, #3771, lands in main.

Agreed.

psss avatar May 27 '25 07:05 psss