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

Add modprobe_module tool #440

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/e2e/lib/ContainerFile.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ RUN dnf install -y \
npm \
rpm-build \
ruby \
ruby-devel \
sed \
vim-enhanced \
systemd-devel \
Expand Down
18 changes: 18 additions & 0 deletions tests/e2e/tools/FFI/module/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# What is modprobe_module?

modprobe_module is a simple script that validates it won't be possible to access /lib/modules to load any module via modprobe inside the QM partition.

# How to use it?

It must be executed inside the QM partition to validate it won't be possible to modprobe any module under /lib/modules.

Example:
```
my-host# podman exec -it qm bash
bash-5.1# ./modprobe_module
modprobe: FATAL: Module ext4 not found in directory /lib/modules/5.14.0-447.400.el9iv.x86_64
ls: cannot access '/lib/modules/5.14.0-447.400.el9iv.x86_64': No such file or directory
done
```
19 changes: 19 additions & 0 deletions tests/e2e/tools/FFI/module/modprobe_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if [ ! -d /lib/modules ]; then
echo "FATAL: /lib/modules: No such file or directory"
exit 1
fi

if [ -n "$(ls -A /lib/modules)" ]; then
echo "This folder should be empty, any modules cannot load via modprobe"
exit 1
fi

# Modprobe module ext4
modprobe ext4

# Access module file
ls $(modprobe ext4 2>&1 >/dev/null | cut -d ' ' -f 9)

echo "done"
Loading