Skip to content

Commit

Permalink
FFI test: Add modprobe_module tool
Browse files Browse the repository at this point in the history
The script will run inside the QM partition. And it won't be possible to access /lib/modules to load any module via modprobe.

Jira-URL: https://issues.redhat.com/browse/VROOM-19336
Signed-off-by: weiwang <[email protected]>
  • Loading branch information
weiwang-linda authored and dougsland committed May 22, 2024
1 parent 2e577bd commit a63db52
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
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"

2 comments on commit a63db52

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

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

Based on your Packit configuration the settings of the rhcontainerbot/podman-next Copr project would need to be updated as follows:

field old value new value
chroots ['fedora-39-x86_64', 'fedora-38-ppc64le', 'epel-9-x86_64', 'centos-stream-10-s390x', 'fedora-eln-aarch64', 'fedora-rawhide-x86_64', 'centos-stream-9-x86_64', 'fedora-40-ppc64le', 'fedora-39-ppc64le', 'fedora-eln-s390x', 'fedora-38-aarch64', 'fedora-38-s390x', 'epel-9-aarch64', 'fedora-rawhide-ppc64le', 'centos-stream-10-ppc64le', 'fedora-38-x86_64', 'fedora-39-s390x', 'fedora-eln-x86_64', 'fedora-eln-ppc64le', 'epel-9-ppc64le', 'centos-stream-10-x86_64', 'fedora-39-aarch64', 'fedora-40-aarch64', 'fedora-rawhide-s390x', 'centos-stream-9-aarch64', 'fedora-40-x86_64', 'centos-stream-9-ppc64le', 'fedora-rawhide-aarch64', 'fedora-40-s390x', 'centos-stream-9-s390x', 'centos-stream-10-aarch64', 'epel-9-s390x'] ['centos-stream+epel-next-9-aarch64', 'centos-stream+epel-next-9-ppc64le', 'centos-stream+epel-next-9-s390x', 'centos-stream+epel-next-9-x86_64', 'centos-stream-10-aarch64', 'centos-stream-10-ppc64le', 'centos-stream-10-s390x', 'centos-stream-10-x86_64', 'centos-stream-9-aarch64', 'centos-stream-9-ppc64le', 'centos-stream-9-s390x', 'centos-stream-9-x86_64', 'epel-9-aarch64', 'epel-9-ppc64le', 'epel-9-s390x', 'epel-9-x86_64', 'fedora-38-aarch64', 'fedora-38-ppc64le', 'fedora-38-s390x', 'fedora-38-x86_64', 'fedora-39-aarch64', 'fedora-39-ppc64le', 'fedora-39-s390x', 'fedora-39-x86_64', 'fedora-40-aarch64', 'fedora-40-ppc64le', 'fedora-40-s390x', 'fedora-40-x86_64', 'fedora-eln-aarch64', 'fedora-eln-ppc64le', 'fedora-eln-s390x', 'fedora-eln-x86_64', 'fedora-rawhide-aarch64', 'fedora-rawhide-ppc64le', 'fedora-rawhide-s390x', 'fedora-rawhide-x86_64']

Diff of chroots:

+centos-stream+epel-next-9-ppc64le
+centos-stream+epel-next-9-x86_64
+centos-stream+epel-next-9-aarch64
+centos-stream+epel-next-9-s390x

Packit was unable to update the settings above as it is missing admin permissions on the rhcontainerbot/podman-next Copr project.

To fix this you can do one of the following:

  • Grant Packit admin permissions on the rhcontainerbot/podman-next Copr project on the permissions page.
  • Change the above Copr project settings manually on the settings page to match the Packit configuration.
  • Update the Packit configuration to match the Copr project settings.

Please retrigger the build, once the issue above is fixed.

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

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

Based on your Packit configuration the settings of the rhcontainerbot/podman-next Copr project would need to be updated as follows:

field old value new value
chroots ['fedora-39-x86_64', 'fedora-38-ppc64le', 'epel-9-x86_64', 'centos-stream-10-s390x', 'fedora-eln-aarch64', 'fedora-rawhide-x86_64', 'centos-stream-9-x86_64', 'fedora-40-ppc64le', 'fedora-39-ppc64le', 'fedora-eln-s390x', 'fedora-38-aarch64', 'fedora-38-s390x', 'epel-9-aarch64', 'fedora-rawhide-ppc64le', 'centos-stream-10-ppc64le', 'fedora-38-x86_64', 'fedora-39-s390x', 'fedora-eln-x86_64', 'fedora-eln-ppc64le', 'epel-9-ppc64le', 'centos-stream-10-x86_64', 'fedora-39-aarch64', 'fedora-40-aarch64', 'fedora-rawhide-s390x', 'centos-stream-9-aarch64', 'fedora-40-x86_64', 'centos-stream-9-ppc64le', 'fedora-rawhide-aarch64', 'fedora-40-s390x', 'centos-stream-9-s390x', 'centos-stream-10-aarch64', 'epel-9-s390x'] ['centos-stream+epel-next-9-aarch64', 'centos-stream+epel-next-9-ppc64le', 'centos-stream+epel-next-9-s390x', 'centos-stream+epel-next-9-x86_64', 'centos-stream-10-aarch64', 'centos-stream-10-ppc64le', 'centos-stream-10-s390x', 'centos-stream-10-x86_64', 'centos-stream-9-aarch64', 'centos-stream-9-ppc64le', 'centos-stream-9-s390x', 'centos-stream-9-x86_64', 'epel-9-aarch64', 'epel-9-ppc64le', 'epel-9-s390x', 'epel-9-x86_64', 'fedora-38-aarch64', 'fedora-38-ppc64le', 'fedora-38-s390x', 'fedora-38-x86_64', 'fedora-39-aarch64', 'fedora-39-ppc64le', 'fedora-39-s390x', 'fedora-39-x86_64', 'fedora-40-aarch64', 'fedora-40-ppc64le', 'fedora-40-s390x', 'fedora-40-x86_64', 'fedora-eln-aarch64', 'fedora-eln-ppc64le', 'fedora-eln-s390x', 'fedora-eln-x86_64', 'fedora-rawhide-aarch64', 'fedora-rawhide-ppc64le', 'fedora-rawhide-s390x', 'fedora-rawhide-x86_64']

Diff of chroots:

+centos-stream+epel-next-9-ppc64le
+centos-stream+epel-next-9-x86_64
+centos-stream+epel-next-9-aarch64
+centos-stream+epel-next-9-s390x

Packit was unable to update the settings above as it is missing admin permissions on the rhcontainerbot/podman-next Copr project.

To fix this you can do one of the following:

  • Grant Packit admin permissions on the rhcontainerbot/podman-next Copr project on the permissions page.
  • Change the above Copr project settings manually on the settings page to match the Packit configuration.
  • Update the Packit configuration to match the Copr project settings.

Please retrigger the build, once the issue above is fixed.

Please sign in to comment.