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

sys-kernel/dracut: enable testing #34052

Closed
wants to merge 1 commit into from

Conversation

LaszloGombos
Copy link
Contributor

@LaszloGombos LaszloGombos commented Nov 29, 2023

Enable running tests for dracut.

Related: https://bugs.gentoo.org/298014 and dracutdevs/dracut#2429

Tests have been running upstream on Gentoo for about 4 months now, so perhaps it is time to try it here - see dracutdevs/dracut#2469

The one issue I found is that some test cases needs to make a copy of /bin/mount binary (copy into an initramfs) and it seems only root has the permission to copy the /bin/mount binary on Gentoo ?

Test 98 has the least amount of dependencies (it does not require copying mount), lets enable just that one test first.

One of the strength of dracut that it is widely used and tested in general, so alpine should try to take use of the test suite as well.

I only changed latest version, but happy to update the PR for other version as well

@LaszloGombos LaszloGombos marked this pull request as draft November 29, 2023 20:22
@LaszloGombos LaszloGombos marked this pull request as ready for review November 29, 2023 20:22
@LaszloGombos LaszloGombos marked this pull request as draft November 29, 2023 20:23
@gentoo-bot
Copy link

Pull Request assignment

Submitter: @LaszloGombos
Areas affected: ebuilds
Packages affected: sys-kernel/dracut

sys-kernel/dracut: @puleglot, @floppym

Linked bugs

No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment.

If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers.


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits. labels Nov 29, 2023
@LaszloGombos LaszloGombos marked this pull request as ready for review November 29, 2023 20:33
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-11-29 21:16 UTC
Newest commit scanned: eef9949
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/15efa75b2f/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-11-29 23:56 UTC
Newest commit scanned: 3b10eb6
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/0b429e85bc/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-11-30 00:16 UTC
Newest commit scanned: fbe5714
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/c92585e09d/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-12-02 01:36 UTC
Newest commit scanned: 9719213
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/7731f7d60c/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-12-02 02:06 UTC
Newest commit scanned: b8a4710
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/c03949c42f/output.html

Test 98 has the least amount of dependencies, lets
enable just that one test first.

Signed-off-by: Laszlo Gombos <laszlo.gombos@gmail.com>
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-12-02 15:01 UTC
Newest commit scanned: 650b044
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/2556c2871d/output.html

@floppym
Copy link
Contributor

floppym commented Dec 4, 2023

The one issue I found is that some test cases needs to make a copy of /bin/mount binary (copy into an initramfs) and it seems only root has the permission to copy the /bin/mount binary on Gentoo ?

I think it is fairly typical to install suid binaries with mode 4711 so that only root has access to read the file. I think this is meant to make exploitation of suid binaries more difficult.

@LaszloGombos
Copy link
Contributor Author

I think it is fairly typical to install suid binaries with mode 4711

Thanks @floppym . Just to be clear this issue with /bin/mount does not impact test 98, so this issue is out of scope of this PR. I mentioned it as this will come up later if and when we attempt to enable more tests.

ewarn "Skipping tests: Unable to access /dev/kvm."
else
emake -C test check
tools/test-github.sh gentoo "98"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about running the full test suite if mount is readable? Something like this:

Suggested change
tools/test-github.sh gentoo "98"
local mount=$(type -P mount)
if [[ -n ${mount} && -r ${mount} ]]; then
emake -C test check
else
tools/test-github.sh gentoo "98" || die
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another potential challange is networked tests - e.g. nfs, iscsi, nbd. The test suite would create a server and client VM with qemu and boot both VMs. Would we want to/is it normally allowed to run this kind of test suites as part of packaging ?

Note that for example that just the NFS test (Test number 20) itself (if everything goes well), runs for about 45 min - see the upstream timeout on networking CI tests - https://github.com/dracutdevs/dracut/blob/master/.github/workflows/integration.yml#L58 . Most of the time this tests times out even with the 45 min timeout limit.

Also note that we do not run networked tests on Gentoo upstream - https://github.com/dracutdevs/dracut/blob/master/.github/workflows/integration.yml#L27

IMHO we want to run only a subset of the tests - at least initially.

There is an attempt to reorganize the test suite upstream so that it is easier to just pick a non-networked tests downstream - see dracutdevs/dracut#2263

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the test-github.sh script, it looks like it runs configure and make to compile the code (again). We don't want to do that in the src_test function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I think this also came up during Debian/Ubuntu discussion. Let me drop some pointers here for now, and I hope to find some time to upload a new revision later.

https://salsa.debian.org/debian/dracut/-/merge_requests/24/

https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2031417

@LaszloGombos
Copy link
Contributor Author

One of the reason I opened this PR as testing dracut on Gentoo is blocked by dracutdevs/dracut#2562 not landing.

This is now resolved by dracut-ng work - dracut-ng/dracut-ng#8, so closing this PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits.
Projects
None yet
4 participants