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

Use beakerlib library from current repository / metadata tree #522

Open
ep69 opened this issue Feb 1, 2021 · 9 comments
Open

Use beakerlib library from current repository / metadata tree #522

ep69 opened this issue Feb 1, 2021 · 9 comments
Labels
area | libraries Issues related to beakerlib libraries support priority | should medium priority, should be included in the next release status | discuss Needs more discussion before closing

Comments

@ep69
Copy link

ep69 commented Feb 1, 2021

As a tester writing the test that needs beakerlib library from the same repository, I want to be able to use that library without specifying URL of the repository, so that the URL information is not duplicated and the whole repository is more maintainable & migratable.

From the discussion we had with @psss, the first step is to have url part of FMF id default to the same repository as the current test. Also, as brought up by @kkaarreell, new convention or specific agreement for rlImport arguments might be needed.

@lukaszachy lukaszachy added area | libraries Issues related to beakerlib libraries support priority | should medium priority, should be included in the next release labels Mar 9, 2023
@kkaarreell
Copy link
Collaborator

We use rlImport ./ica for our library but this approach won't ensure that library requires are installed.
https://gitlab.cee.redhat.com/rhel-tests/openssl-ibmca/-/blob/main/integration/mod_ssl-using-ibmca-hw-acceleration/test.sh#L20

@lukaszachy
Copy link
Collaborator

FTR: Either 'url' or 'path' is currently required when processing requires.
We had defined 'fmf-id' that when url is missing it should be the current repo - thus omitting 'url' should lead to the desired "detect library from the current tree" situation.

@lukaszachy lukaszachy added this to the 1.23 milestone Mar 9, 2023
@psss psss modified the milestones: 1.23, 1.24 Apr 25, 2023
@psss psss added the status | discuss Needs more discussion before closing label Apr 25, 2023
@lukaszachy lukaszachy modified the milestones: 1.24, 1.25 May 16, 2023
@sopos
Copy link

sopos commented May 16, 2023

I think it should work even with the file type require. That should ensure the respective file is synced to guest.
Beakerlib should be already capable to handle a require defined by the name only, possibly with path as well; so rlImport --all or a dependent requires should be handled correctly.

@psss
Copy link
Collaborator

psss commented Jun 20, 2023

As @sopos mentioned the library should be found using the upward directory traversal. @ep69, could you confirm this does not work for you?

@ep69
Copy link
Author

ep69 commented Jun 21, 2023

What exact scenario are we discussing? rlImport fips / rlImport distribution/fips / rlImport crypto/fips + require: library(<same>) in main.fmf? What is expected to work and what not?

@sopos
Copy link

sopos commented Jun 23, 2023

All should work if you have the following directory structure in the repo:
[/libs]/fips
[/libs]/distribution/fips
[/libs]/crypto/fips

Except for the require: library(...). which would make tmt to try to install it which would fail. For that you would need to use the new type: file require.

@psss psss removed this from the 1.25 milestone Jun 27, 2023
@ep69
Copy link
Author

ep69 commented Sep 8, 2023

This is not a high priority as I am able to workaround it, but it does not seem to be working for my case.

I was mostly looking for a way to have same test script and metadata running in two environments:

  1. in internal company network, downloading the library (e.g., distribution/fips) from default place where it is stored
  2. in public environment, having the libraries pre-downloaded in /libs in current repo

Is something like this possible? If so, cool, I can get rid of my workarounds and rewrites. If not, I can go on with my life, too.

@ep69
Copy link
Author

ep69 commented Sep 8, 2023

Btw, specifying library without url:, just with path:, somehow does not work for me:

require:
  - type: library
    path: /libs/distribution
    name: /fips

gives me:

# tmt run -avvv plans -n interop tests -f "tag:interop-gnutls" provision -h local execute -h tmt --interactive test -n /Interoperability/gnutls_TLSv1-2-with-OpenSSL
/var/tmp/tmt/run-010
Found 1 plan.

/plans/interop
summary: Upstream interoperability
    discover
        how: fmf
        order: 50
        directory: /root/interop
        hash: 3def3aa
        filter: tag: interop
    finish
    
    Prune '/plans/interop' plan workdir '/var/tmp/tmt/run-010/plans/interop'.
        summary: 0 tasks completed

plan failed

The exception was caused by 1 earlier exceptions

Cause number 1:

    unhashable type: 'DependencyFmfId'

# tmt --version
tmt version: 1.26.1 (514544b2)

@kkaarreell
Copy link
Collaborator

If the library Is in the same repo why adding it to requires?

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 priority | should medium priority, should be included in the next release status | discuss Needs more discussion before closing
Projects
None yet
Development

No branches or pull requests

5 participants