Bug#893035: autopkgtest: doesn't escape commands in Test-Command properly, causing "testbed failure: cannot send to testbed"

Paul Gevers elbrus at debian.org
Thu Mar 15 20:09:44 UTC 2018

Package: autopkgtest
Version: 5.1
Severity: normal
Control: owner !

Hash: SHA256

The current test suite of anosql has this in the d/t/control file:
Test-Command: python -c 'import anosql; print("Anosql successfully installed")'
Depends: python3-anosql

The log¹ on ci.d.n end with the following:
autopkgtest [12:05:09]: test command1: python -c 'import anosql; print("Anosql successfully installed")'
autopkgtest [12:05:09]: test command1: [-----------------------
bash: -c: line 0: syntax error near unexpected token `"Anosql successfully installed"'
bash: -c: line 0: `set -e; export USER=`id -nu`; . /etc/profile >/dev/null 2>&1 || true;  . ~/.profile >/dev/null 2>&1 || true; buildtree="/tmp/autopkgtest-lxc.ybez4dec/downtmp/build.sSE/src"; mkdir -p -m 1777 -- "/tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-artifacts"; export AUTOPKGTEST_ARTIFACTS="/tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-artifacts"; export ADT_ARTIFACTS="$AUTOPKGTEST_ARTIFACTS"; mkdir -p -m 755 "/tmp/autopkgtest-lxc.ybez4dec/downtmp/autopkgtest_tmp"; export AUTOPKGTEST_TMP="/tmp/autopkgtest-lxc.ybez4dec/downtmp/autopkgtest_tmp"; export ADTTMP="$AUTOPKGTEST_TMP"; export DEBIAN_FRONTEND=noninteractive; export LANG=C.UTF-8; export DEB_BUILD_OPTIONS=parallel=2; unset LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE   LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS   LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL;rm -f /tmp/autopkgtest_script_pid; set -C; echo $$ > /tmp/autopkgtest_script_pid; set +C; trap "rm -f /tmp/autopkgtest_script_pid" EXIT INT QUIT PIPE; cd "$buildtree"; touch /tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-stdout /tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-stderr; bash -ec 'python -c 'import anosql; print("Anosql successfully installed")'' 2> >(tee -a /tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-stderr >&2) > >(tee -a /tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-stdout);'
autopkgtest [12:05:10]: test command1: -----------------------]
Unexpected error:
Traceback (most recent call last):
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 717, in mainloop
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 646, in command
    r = f(c, ce)
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 584, in cmd_copyup
    copyupdown(c, ce, True)
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 469, in copyupdown
    copyupdown_internal(ce[0], c[1:], upp)
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 494, in copyupdown_internal
    copyup_shareddir(sd[0], sd[1], dirsp, downtmp_host)
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 408, in copyup_shareddir
    shutil.copy(tb, host)
  File "/usr/lib/python3.5/shutil.py", line 241, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.5/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/autopkgtest-lxc.ybez4dec/downtmp/command1-stdout'
autopkgtest [12:05:11]: ERROR: testbed failure: cannot send to testbed: [Errno 32] Broken pipe

Obviously, the single quotes in the Test-Command should be escaped.


¹ https://ci.debian.net/data/autopkgtest/unstable/amd64/a/anosql/20180315_120445/log.gz

- -- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (200, 'testing'), (50, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages autopkgtest depends on:
ii  apt-utils       1.6~beta1
ii  libdpkg-perl
ii  procps          2:3.3.12-4
ii  python3         3.6.4-1
ii  python3-debian  0.1.32

Versions of packages autopkgtest recommends:
ii  autodep8  0.11.1

Versions of packages autopkgtest suggests:
ii  lxc          1:2.0.9-6
pn  lxd-client   <none>
pn  qemu-system  <none>
ii  qemu-utils   1:2.11+dfsg-1
ii  schroot      1.6.10-4

- -- no debconf information



More information about the autopkgtest-devel mailing list