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

tests: try to populate lt-ublk.{target} first in test code #103

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

ming1
Copy link
Collaborator

@ming1 ming1 commented Feb 28, 2025

The test code runs the executable from the top directory, which is actually one script, and finally 'lt-ublk' could be generated in .libs/, but 'lt-ublk.${target}' can't be generated in this way, and causes test failure, see issue github #102 when running ublk test on rhel10.

Fixes it by trying to populate 'lt-ublk.${target}' first by running 'ublk.{target} help' command.

@ming1
Copy link
Collaborator Author

ming1 commented Feb 28, 2025

Hello @RonnieSahlberg

Care to take a look and see if way is good?

Thanks,

@RonnieSahlberg
Copy link
Contributor

Ouch. Yes, that is a good workaround for now.
Alternatively you can run "ublk.null add -t null -q 1 ..." instead of "ublk add -t null -q 1 ..."

I will work on a fix for upstream.

@sahlberg
Copy link

Autotools is pretty terrible sometimes :-(

For the tests I think perhaps just calling the target specific programs directly instead of via "ublk" might be a viable option when just running them from the test directory as I mentioned above.

@ming1
Copy link
Collaborator Author

ming1 commented Feb 28, 2025

Ouch. Yes, that is a good workaround for now. Alternatively you can run "ublk.null add -t null -q 1 ..." instead of "ublk add -t null -q 1 ..."

I'd suggest to avoid that:

  • too many changes

  • we need to support background for each target code of ublk.{target}

Thanks,

@ming1 ming1 closed this Feb 28, 2025
@ming1 ming1 reopened this Feb 28, 2025
The test code runs the executable from the top directory, which is
actually one script, and finally 'lt-ublk' could be generated in .libs/,
but 'lt-ublk.${target}' can't be generated in this way, and causes
test failure, see issue github #102 when running ublk test on rhel10.

Fixes it by trying to populate 'lt-ublk.${target}' first by running
'ublk.{target} help' command.

Reported-by: czhong github issue #102
Approved-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
@ming1 ming1 merged commit 246ed8d into master Feb 28, 2025
1 check passed
@sahlberg
Copy link

sahlberg commented Feb 28, 2025

Another alternative could be to add a check if execve() fails due to not finding the executable
then we could try running "./" + argv[0] + ".target" instead.

  • "./" if argc[0] does not contain any path components. Let me try some.

No, that wouldn't work. Well well this PR fixes it for the tests.

@ming1
Copy link
Collaborator Author

ming1 commented Feb 28, 2025

Another alternative could be to add a check if execve() fails due to not finding the executable then we could try running "./" + argv[0] + ".target" instead.

* "./" if argc[0] does not contain any path components.   Let me try some.

No, that wouldn't work. Well well this PR fixes it for the tests.

The issue can't happen on installed binary, which won't be libtool script or lt-ublk, so it should be fine to workaround it in test script.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants