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

QA Failure for vmimage extractor (vmimage.py): libguestfs configuration on Ubuntu #69

Open
ArkaprabhaChakraborty opened this issue Jan 25, 2025 · 2 comments · May be fixed by #70
Open

Comments

@ArkaprabhaChakraborty
Copy link

CI job for any builds on Ubuntu 22 fails due to:

extractcode.ExtractErrorFailedToExtract: Unable to read kernel at: /boot/vmlinuz-6.5.0-1025-azure.
libguestfs requires the kernel executable to be readable.
This is the case by default on most Linux distributions except on Ubuntu.

This exception is raised at:

2025-01-25T13:22:44.5081493Z            for kern in kernels:
2025-01-25T13:22:44.5081633Z                 if not os.access(kern, os.R_OK):
2025-01-25T13:22:44.5081786Z >                   raise ExtractErrorFailedToExtract(
2025-01-25T13:22:44.5081938Z                         f'Unable to read kernel at: {kern}.\n'
2025-01-25T13:22:44.5082088Z                         f'{GUESTFISH_KERNEL_NOT_READABLE}'
2025-01-25T13:22:44.5082214Z                     )

This could be handled using mocking for testing scenarios. However, more research is required on how such mocking can be implemented.

@ArkaprabhaChakraborty
Copy link
Author

I'll try to make a pull request for this.

@ArkaprabhaChakraborty
Copy link
Author

def is_kernel_readable():
    """
    Check if the kernel is readable by testing access to /boot/vmlinuz-*.
    Return True if readable, False otherwise.
    """
    if not os.name == "posix":
        return False  # Skip on non-Linux systems

    try:
        kernels = list(Path("/boot").glob("vmlinuz-*"))
        if not kernels:
            return False  # No kernel found
        return all(os.access(kern, os.R_OK) for kern in kernels)
    except Exception:
        return False  # Kernel check failed

@pytest.mark.skipif(not on_linux, reason='Only linux supports image extraction')

can fix the kernel not readable CI bug for now.

@ArkaprabhaChakraborty ArkaprabhaChakraborty linked a pull request Jan 25, 2025 that will close this issue
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 a pull request may close this issue.

1 participant