Skip to content

Commit

Permalink
tests/interception: support .zst compressed modules
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
  • Loading branch information
simondeziel committed May 29, 2024
1 parent 0ac29b3 commit f54c858
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/interception
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ if hasNeededAPIExtension container_syscall_intercept_finit_module; then
# upload module file into the container
lxc file push "${MODULE_PATH}" "c1/root/"

# deal with zstd compressed .ko
if echo "${MODULE_FILE_NAME}" | grep -q "\.zst$"; then
lxc exec c1 -- apt-get update -qq
lxc exec c1 -- apt-get install --no-install-recommends -y zstd
lxc exec c1 -- unzstd "/root/${MODULE_FILE_NAME}"
MODULE_FILE_NAME="$(basename "${MODULE_PATH}" .zst)"
fi

# negative case 1 (feature is not enabled)
! lxc exec c1 -- insmod "/root/${MODULE_FILE_NAME}" || false

Expand Down

0 comments on commit f54c858

Please sign in to comment.