Package: autopkgtest
Version: 5.16
Severity: normal

Dear Maintainer,

If I have such a line in the d/tests/control

Test-Command: modprobe --verbose --set-version "$(for kernel in /boot/config-
*;
do echo ${kernel#*-}; done | tail -n1)" my_kernel_module

It will consider the command is only

modprobe --verbose --set-version "$(for kernel in /boot/config-*; do echo
${kernel

Everything after '#' is ignored, as stated in [1]

Would you provide a way to escape it? I don't know how though...

For example in debhelper [2] to escape a $, they suggest ${Dollar}. Or for a
new line, they would do ${Newline}. So maybe something similar, like ${Hash} 
or
${NumberSign}. But the use of the dollar sign, wouldn't be very optimal since
it already has a meaning in shell.

[1] 
https://salsa.debian.org/ci-team/autopkgtest/blob/master/doc/README.package-tests.rst
[2] https://manpages.debian.org/bullseye/debhelper/debhelper.7.en.html

For now, I put the command in a separate script called with "Command:"



-- System Information:
Debian Release: 11.5
  APT prefers stable-updates
  APT policy: (991, 'stable-updates'), (991, 'stable'), (95, 'testing'), (90,
'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-18-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8),
LANGUAGE=fr:en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages autopkgtest depends on:
ii  apt-utils       2.2.4
ii  libdpkg-perl    1.20.12
ii  procps          2:3.3.17-5
ii  python3         3.9.2-3
ii  python3-debian  0.1.39

Versions of packages autopkgtest recommends:
ii  autodep8  0.24

Versions of packages autopkgtest suggests:
pn  lxc               <none>
pn  lxd               <none>
pn  ovmf              <none>
pn  qemu-efi-aarch64  <none>
pn  qemu-efi-arm      <none>
pn  qemu-system       <none>
ii  qemu-utils        1:5.2+dfsg-11+deb11u2
ii  schroot           1.6.10-12+deb11u1
ii  vmdb2             0.22-1

Reply via email to