Public bug reported:

[ Impact ]

When running autopkgtest for resource-agents in a VM testbed with a
minimal kernel (such as LXD VMs on Jammy running linux-image-kvm), the
`debian/tests/run-ocft iscsi` test fails during SETUP-AGENT with:

    ERROR: Warning: Could not load preferences file /root/.targetcli/prefs.bin.
    b'modprobe: FATAL: Module iscsi_target_mod not found in directory 
/lib/modules/5.15.0-1109-kvm\n'
    ERROR: 'SETUP-AGENT' failed, the return code is 1.
    WARNING: SETUP failed, break all tests of 'iscsi'.
    command13 FAIL non-zero exit status 1

Investigation into the kernel configuration of linux-kvm on Jammy (from 
linux-buildinfo-*-kvm) shows:
    CONFIG_TARGET_CORE=m
    # CONFIG_ISCSI_TARGET is not set

The linux-kvm kernel flavour intentionally disables the LIO iSCSI target
subsystem (`# CONFIG_ISCSI_TARGET is not set`), and there are no
`iscsi_target_mod.ko` modules built for it. Furthermore, simply
installing `linux-modules-extra-*-generic` in `debian/tests/control`
does not resolve the issue, because `modprobe` cannot load generic
kernel modules into a running `linux-kvm` kernel due to version, ABI,
and module signature mismatches.

Therefore, the cleanest and most robust solution conforming to
Debian/Ubuntu autopkgtest standards is to check whether
`iscsi_target_mod` can be probed by the running kernel, and gracefully
SKIP the test when kernel support is absent. This prevents false-
positive autopkgtest regressions from blocking proposed migration for
reverse dependencies such as open-iscsi (LP: #2147499).

[ Test Plan ]

1. On a testbed running a kernel without iscsi_target_mod support (e.g. Jammy 
LXD VM running linux-kvm):
   Run:
       sudo debian/tests/run-ocft iscsi
   Expected result before fix:
       Fails during setup with FATAL: Module iscsi_target_mod not found, exit 
status 1.
   Expected result after fix:
       Outputs:
           SKIP: iscsi_target_mod module is not available in running kernel 
<version>
       and exits 0 (clean skip / pass).

2. On a testbed running a generic kernel where iscsi_target_mod is available 
(e.g. linux-image-generic):
   Run:
       sudo debian/tests/run-ocft iscsi
   Expected result:
       Module loads and ocft test -v iscsi executes and passes normally.

[ Where problems could occur ]

The fix only touches the autopkgtest test runner script 
`debian/tests/run-ocft`. It does not modify any binaries, packaged agent 
scripts, or runtime behavior of resource-agents itself.
The only potential risk is if a regression in the iscsi resource agent is not 
caught on environments lacking kernel module support; however, on generic 
environments the test will continue to execute fully as before.

[ Other Info ]

Relevant discussion in LP: #2147499 comment #24.
Tag: block-proposed-jammy

** Affects: resource-agents (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: block-proposed-jammy

** Tags added: block-proposed-jammy

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2170272

Title:
  [SRU] resource-agents: autopkgtest iscsi fails on kernels without LIO
  iSCSI target support (e.g. linux-kvm)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resource-agents/+bug/2170272/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to