Skip to content

Conversation

@LecrisUT
Copy link
Contributor

@LecrisUT LecrisUT commented Dec 12, 2025

Without those keys we take the tmt tree to be the default value for the path

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • modify the json schema
  • mention the version
  • include a release note

Fixes #4422

@LecrisUT LecrisUT added the ci | full test Pull request is ready for the full test execution label Dec 12, 2025
@LecrisUT LecrisUT added the area | libraries Issues related to beakerlib libraries support label Dec 15, 2025
@LecrisUT LecrisUT marked this pull request as ready for review December 15, 2025 08:46
@github-project-automation github-project-automation bot moved this to backlog in planning Dec 15, 2025
@LecrisUT LecrisUT moved this from backlog to review in planning Dec 15, 2025
@HouMinXi
Copy link

after testing, name work as design. More test log please check attachment.
Uploading tmt_4427.tar.gz…

        prepare task #2: default-0 on client (client) and server (server)
[server (server)]         started
[server (server)]         how: install
[client (client)]         started
[server (server)]         summary: install packages
[client (client)]         how: install
[server (server)]         guest: server
[server (server)]         package: 21 packages requested
[client (client)]         summary: install packages
[server (server)]             bc
[client (client)]         guest: client
[server (server)]             beakerlib-redhat
[server (server)]             bind-utils
[server (server)]             bzip2
[server (server)]             ethtool
[server (server)]             expect
[server (server)]             gcc
[server (server)]             git
[server (server)]             iproute
[server (server)]             libtool
[server (server)]             lsof
[server (server)]             nc
[server (server)]             net-tools
[server (server)]             nmap
[server (server)]             nmap-ncat
[server (server)]             patch
[server (server)]             rsync
[server (server)]             socat
[server (server)]             tcpdump
[server (server)]             traceroute
[server (server)]             wget
[client (client)]         package: 21 packages requested
[client (client)]             bc
[client (client)]             beakerlib-redhat
[client (client)]             bind-utils
[client (client)]             bzip2
[client (client)]             ethtool
[client (client)]             expect
[client (client)]             gcc
[client (client)]             git
[client (client)]             iproute
[client (client)]             libtool
[client (client)]             lsof
[client (client)]             nc
[client (client)]             net-tools
[client (client)]             nmap
[client (client)]             nmap-ncat
[client (client)]             patch
[client (client)]             rsync
[client (client)]             socat
[client (client)]             tcpdump
[client (client)]             traceroute
[client (client)]             wget

Without those keys we take the tmt tree to be the default value for the `path`

Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
@LecrisUT
Copy link
Contributor Author

LecrisUT commented Dec 16, 2025

Ok @HouMinXi ready for a second try. To elaborate on the requirement. Let's say you have a repo example.com/Me/some_repo that has both beakerlib library and some tmt tests that want to test that library, something arranged like:

$ tree -a .
.
├── .fmf
│   └── version
├── my_lib
│   ├── lib.sh
│   └── main.fmf
├── plans
│   └── main.fmf
└── tests
    ├── my_lib.fmf
    └── test.sh

5 directories, 6 files

Then what you care about is how you define the tests, e.g. in this case it is /tests/my_lib

summary: Test the my_lib beakerlib library
test: test.sh
require:
  - type: library
    name: /my_lib
    nick: some_repo

and the tests file

#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1

rlJournalStart
    rlPhaseStartSetup
        rlRun "rlImport some_repo/my_lib"
    rlPhaseEnd

    rlPhaseStartTest
        rlRun "..."
    rlPhaseEnd

    rlPhaseStartCleanup
    rlPhaseEnd
rlJournalEnd

Particularly see the some_repo here matching nick and should match however you or your external users would consume the beakerlib library.

Hope this breakdown makes sense?

Signed-off-by: Cristian Le <git@lecris.dev>
@HouMinXi
Copy link

Here is my test topo
repo: https://gitlab.cee.redhat.com/mhou/kernel
branch: mhou_tmp_branch

My simplified file-topology is as follows:

.
├── .fmf
│   └── version
networking
├── common
│   └── main.fmf
└── openvswitch
    └── topo
        └── main.fmf

in /networking/openvswitch/topo/main.fmf, I define the local file library as below:

summary: ovs topo testing
description: |
    FIXME: more description about ovs topo
contact: Rick Alongi <ralongi@redhat.com>
component:
  - openvswitch
test: bash ./runtest.sh
framework: beakerlib
require:
  - type: library
    name: /networking/common
    nick: kernel
duration: 24h
extra-summary: /kernel/networking/openvswitch/topo
extra-task: /kernel/networking/openvswitch/topo

In plan-level I define discover as below:

- name: ovs_topo
      how: fmf
      url: https://gitlab.cee.redhat.com/mhou/kernel/-/archive/mhou_tmp_branch/kernel-mhou_tmp_branch.tar.gz
      url-content-type: archive
      path: kernel-mhou_tmp_branch
      test:
        - ^/networking/openvswitch/topo$

run the tmt with debug mode, raise error Failed to find library kernel/common at /var/tmp/tmt/run-008/openvswitch/topo/plan/discover/ovs_topo/tests

    discover
    workdir: /var/tmp/tmt/run-008/openvswitch/topo/plan/discover
        how: fmf
        name: ovs_topo
        order: 50
        Workdir '/var/tmp/tmt/run-008/openvswitch/topo/plan/discover/ovs_topo' created.
        url: https://gitlab.cee.redhat.com/mhou/kernel/-/archive/mhou_tmp_branch/kernel-mhou_tmp_branch.tar.gz
        Downloading 'https://gitlab.cee.redhat.com/mhou/kernel/-/archive/mhou_tmp_branch/kernel-mhou_tmp_branch.tar.gz'.
        Extracting archive to '/var/tmp/tmt/run-008/openvswitch/topo/plan/discover/ovs_topo/tests'.
        Run command: git rev-parse --short HEAD
        err: fatal: not a git repository (or any of the parent directories): .git
        Command returned '128' (unrecognized).
        path: kernel-mhou_tmp_branch
        tests: ^/networking/openvswitch/topo$
        Check metadata tree in '/var/tmp/tmt/run-008/openvswitch/topo/plan/discover/ovs_topo/tests/kernel-mhou_tmp_branch'.
        Detected library '{'name': '/networking/common', 'nick': 'kernel', 'type': 'library'}'.
        Fetch library 'kernel/common'.
        Failed to find library kernel/common at /var/tmp/tmt/run-008/openvswitch/topo/plan/discover/ovs_topo/tests
        summary: 1 test selected
            /ovs_topo/networking/openvswitch/topo
    status: done
    Write file '/var/tmp/tmt/run-008/openvswitch/topo/plan/discover/step.yaml'.
    Write file '/var/tmp/tmt/run-008/openvswitch/topo/plan/discover/tests.yaml'.
Plan shaper 'max-tests' not applicable.
Plan shaper 'repeat' not applicable.
            Run command: git rev-parse --is-inside-work-tree
            err: fatal: not a git repository (or any of the parent directories): .git
            Command returned '128' (unrecognized).
    Write file '/var/tmp/tmt/run-008/openvswitch/topo/plan/execute/step.yaml'.
    Write file '/var/tmp/tmt/run-008/openvswitch/topo/plan/execute/results.yaml'.
    provision
    workdir: /var/tmp/tmt/run-008/openvswitch/topo/plan/provision

@LecrisUT LecrisUT self-assigned this Dec 18, 2025
@psss psss added this to the 1.65 milestone Jan 8, 2026
@tcornell-bus tcornell-bus self-requested a review January 8, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | libraries Issues related to beakerlib libraries support ci | full test Pull request is ready for the full test execution

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

Need support only name in test level require

4 participants