Package: autopkgtest
Version: 5.42
Severity: normal

Hi,

I'm trying to add podman support to debci and in the process I had autopkgtest fail to run with an image created with autopkgtest-build-podman:

root@host:/tmp/autopkgtest.K9hkde/build.MFf/real-tree# autopkgtest debian/tests/testpkg/ -- podman debian:unstable
autopkgtest [18:54:40]: starting date and time: 2025-01-19 18:54:40+0000
autopkgtest [18:54:40]: version 5.43
autopkgtest [18:54:40]: host host; command line: /usr/bin/autopkgtest debian/tests/testpkg/ -- podman debian:unstable
Unexpected error:
Traceback (most recent call last):
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 833, in mainloop
    command()
    ~~~~~~~^^
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 762, in command
    r = f(c, ce)
  File "/usr/share/autopkgtest/lib/VirtSubproc.py", line 351, in cmd_open
    caller.hook_open()
    ~~~~~~~~~~~~~~~~^^
  File "/usr/bin/autopkgtest-virt-podman", line 197, in hook_open
    if labels.get('org.debian.autopkgtest.init', '') not in ('', 'none'):
       ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
autopkgtest [18:54:40]: ERROR: testbed failure: unexpected eof from the testbed
Exception ignored in: <_io.TextIOWrapper name=6 encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe



My current implementation generates an image logged like so:
+ debci setup --backend podman
I: testbed setup [unstable/amd64/podman]: starting at Sun Jan 19 20:41:08 CET 2025
debian-distro-info: unknown distribution series `unstable'
WARNING: podman requires either passt or slirp4netns, depending on version
INFO:autopkgtest-build-docker:['podman', 'build', '--tag', 'autopkgtest/debian:unstable', '--tag', 'autopkgtest/amd64/debian:unstable', '--build-arg=IMAGE=debian:unstable', '--build-arg=AUTOPKGTEST_APT_PROXY=', '--build-arg=AUTOPKGTEST_APT_SOURCES=deb http://deb.debian.org/debian unstable main contrib non-free non-free-firmware\ndeb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware\ndeb http://deb.debian.org/debian-debug unstable-debug main contrib non-free non-free-firmware\ndeb-src http://deb.debian.org/debian-debug unstable-debug main contrib non-free non-free-firmware\n', '--build-arg=AUTOPKGTEST_SETUP_APT_PROXY=', '--build-arg=AUTOPKGTEST_SETUP_VM_POST_COMMAND=\nDEBIAN_FRONTEND=noninteractive apt-get install dpkg-dev ca-certificates -q -y --no-install-recommends\n\nDEBIAN_FRONTEND=noninteractive apt-get clean\n\nuseradd --home-dir /home/debci --create-home debci\n', '--build-arg=RELEASE=unstable', '/tmp/tmp86x3w643']

The line to autopkgtest-build-podman was (I think) like:
autopkgtest-build-podman --vendor debian --release unstable --post-command '
DEBIAN_FRONTEND=noninteractive \
  apt-get install dpkg-dev ca-certificates -q -y --no-install-recommends
DEBIAN_FRONTEND=noninteractive \
  apt-get clean

useradd \
  --home-dir /home/debci \
  --create-home   debci
'



If I then run $(podman image inspect debian:unstable) I get:
# podman image inspect debian:unstable
[
     {
"Id": "7482abf13fa40476b31274f3bd5fde5777670ea69c665d17e5decbbf78af639d", "Digest": "sha256:223ab26e710a24a3033518f2c2f1fb22e4aa5ba5626ce00eea01e19ef3b58a18",
          "RepoTags": [
               "docker.io/library/debian:unstable"
          ],
          "RepoDigests": [
"docker.io/library/debian@sha256:223ab26e710a24a3033518f2c2f1fb22e4aa5ba5626ce00eea01e19ef3b58a18", "docker.io/library/debian@sha256:7a1bf1b8fa1b22173fe5cf9c0d8747e935ac710363760179b1502e3354a47ee0"
          ],
          "Parent": "",
          "Comment": "debuerreotype 0.15",
          "Created": "2025-01-13T00:00:00Z",
          "Config": {
               "Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
               ],
               "Cmd": [
                    "bash"
               ]
          },
          "Version": "",
          "Author": "",
          "Architecture": "amd64",
          "Os": "linux",
          "Size": 122031961,
          "VirtualSize": 122031961,
          "GraphDriver": {
               "Name": "overlay",
               "Data": {
"UpperDir": "/var/lib/containers/storage/overlay/8fd0f276c751504af7d4a2be938fe05bf5ed8db6e5888b6d26af84e64f51032f/diff", "WorkDir": "/var/lib/containers/storage/overlay/8fd0f276c751504af7d4a2be938fe05bf5ed8db6e5888b6d26af84e64f51032f/work"
               }
          },
          "RootFS": {
               "Type": "layers",
               "Layers": [
"sha256:8fd0f276c751504af7d4a2be938fe05bf5ed8db6e5888b6d26af84e64f51032f"
               ]
          },
          "Labels": null,
          "Annotations": {},
          "ManifestType": "application/vnd.oci.image.manifest.v1+json",
          "User": "",
          "History": [
               {
                    "created": "2025-01-13T00:00:00Z",
"created_by": "# debian.sh --arch 'amd64' out/ 'unstable' '@1736726400'",
                    "comment": "debuerreotype 0.15"
               }
          ],
          "NamesHistory": [
               "docker.io/library/debian:unstable"
          ]
     }
]


That doesn't have a Config.Labels field, so $(podman image inspect --format='{{json .Config.Labels}}' debian:unstable) returns "null" which by json.loads() is converted to None.

Should autopkgtest-virt-podman on line 197 test for "labels is not None" first, or is this maybe a bug in autopkgtest-build-podman?

Paul

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to