Skip to content

Commit

Permalink
Merge pull request #230 from desultory/kmod_recursion
Browse files Browse the repository at this point in the history
fix kmod recursion, add tests
  • Loading branch information
desultory authored Feb 25, 2025
2 parents da21b66 + d1d9d23 commit c5f3ddc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ugrd/kmod/kmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ def _process_kmod_dependencies(self, kmod: str, mod_tree=None) -> None:
continue
try:
self.logger.debug("[%s] Processing dependency: %s" % (kmod, dependency))
_process_kmod_dependencies(self, dependency, mod_tree)
mod_tree.add(dependency)
_process_kmod_dependencies(self, dependency, mod_tree)
except BuiltinModuleError as e:
self.logger.debug(e)
continue
Expand Down
16 changes: 16 additions & 0 deletions tests/test_kmod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from unittest import TestCase, main

from ugrd.initramfs_generator import InitramfsGenerator
from zenlib.logging import loggify


@loggify
class TestKmod(TestCase):
def test_kmod_recursion(self):
""" Check that kernel modules with recursive dependencies don't cause infinite recursion """
generator = InitramfsGenerator(logger=self.logger, kmod_init=["ipmi_si"], config="tests/fullauto.toml")
generator.build()


if __name__ == "__main__":
main()

0 comments on commit c5f3ddc

Please sign in to comment.