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

test: make dracut directory and package libdir configurable #2484

Merged
merged 4 commits into from
Aug 16, 2023

Conversation

bdrung
Copy link
Contributor

@bdrung bdrung commented Aug 15, 2023

Changes

Make the directory of the dracut.sh script and the package libdir configurable to allow running the test suite out-of-tree. PKGLIBDIR can be pointed to the installed dracut libdir. Use PKGLIBDIR for the location of dracut-init.sh, dracut-install,
dracut-util, dracut-cpio, and modules.d.

This change is used to run the test suite against the installed dracut in an autopkgtest for the Debian/Ubuntu package.

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

@github-actions github-actions bot added the test Issues related to testing label Aug 15, 2023
test/test-functions Outdated Show resolved Hide resolved
Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

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

I support the spirit of this change, but test/test-functions needs to be fixed before this can land.

@bdrung bdrung force-pushed the test-out-of-tree branch 2 times, most recently from 28a6876 to ff633b5 Compare August 15, 2023 23:24
Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

Missing:

pr-2484> grep -r -n --color modules.d test
test/TEST-50-MULTINIC/test.sh:337:        inst_hook pre-pivot 85 "$basedir/modules.d/45ifcfg/write-ifcfg.sh"
test/TEST-98-GETARG/test.sh:17:    ln -sfnr "$basedir"/modules.d/99base/dracut-lib.sh "$TESTDIR"/dracut-lib.sh
test/TEST-98-GETARG/test.sh:18:    ln -sfnr "$basedir"/modules.d/99base/dracut-dev-lib.sh "$TESTDIR"/dracut-dev-lib.sh

I see that this PR is only about configuring dracut.sh and modules.d. Isn't it worth adding the other files that use basedir as well, i.e.: dracut-init.sh, dracut-install, dracut-util and dracut-cpio for completeness?

Make the directory of the `dracut.sh` script configurable to allow
running the test suite out-of-tree.

This change is used to run the test suite against the installed dracut
in an autopkgtest for the Debian/Ubuntu package.

Signed-off-by: Benjamin Drung <[email protected]>
@bdrung
Copy link
Contributor Author

bdrung commented Aug 16, 2023

Thanks @aafeijoo-suse for pointing it out. I reworked the patches. Now you can set DRACUT and PKGLIBDIR.

Side note: Good news for running the first four tests on Ubuntu against the installed package: https://autopkgtest.ubuntu.com/packages/dracut. amd64 is working, but the other architectures are failing. Patches will be coming. Brace yourself. ;)

@bdrung bdrung changed the title test: Make dracut and modules.d directory configurable test: make dracut directory and package libdir configurable Aug 16, 2023
Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

Thanks @aafeijoo-suse for pointing it out. I reworked the patches. Now you can set DRACUT and PKGLIBDIR.

No, thanks to you for working on this. It's good to see some interest from Debian :)

You need to fix this shell issue: https://github.com/dracutdevs/dracut/actions/runs/5877491623/job/15938056367?pr=2484#step:4:18

test/TEST-98-GETARG/test.sh Outdated Show resolved Hide resolved
Make the package libdir configurable to allow running the test suite
out-of-tree. `PKGLIBDIR` can be pointed to the installed dracut libdir.
Use `PKGLIBDIR` for the location of `dracut-init.sh`, `dracut-install`,
`dracut-util`, `dracut-cpio`, and `modules.d`.

This change is used to run the test suite against the installed dracut
in an autopkgtest for the Debian/Ubuntu package.

Signed-off-by: Benjamin Drung <[email protected]>
Building `dracut-util` requires the source code to be present and
prevents running the test against the installed system. Check that
`dracut-util` and rely on the test environment to build `dracut-util`
beforehand.
The `skipcpio` binary is installed in `${PKGLIBDIR}/skipcpio`.

Signed-off-by: Benjamin Drung <[email protected]>
@bdrung
Copy link
Contributor Author

bdrung commented Aug 16, 2023

No, thanks to you for working on this. It's good to see some interest from Debian :)

The interest is coming from Ubuntu and was caused by using dracut-install in initramfs-tools: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2031185

You need to fix this shell issue: https://github.com/dracutdevs/dracut/actions/runs/5877491623/job/15938056367?pr=2484#step:4:18

Done.

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

@bdrung
Copy link
Contributor Author

bdrung commented Aug 16, 2023

Fixed commit message title.

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

Thanks!

@LaszloGombos LaszloGombos merged commit 028f763 into dracutdevs:master Aug 16, 2023
84 of 92 checks passed
@bdrung bdrung deleted the test-out-of-tree branch August 16, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants