Problems with adt-virt-qemu and copydown

Iustin Pop iustin at debian.org
Tue Jul 22 20:28:17 UTC 2014


On Tue, Jul 22, 2014 at 05:22:46AM +0200, Martin Pitt wrote:
> Hey Iustin,
> 
> Iustin Pop [2014-07-21 20:51 +0200]:
> > I found a weird problem with adt-virt-qemu: copydown creates zero-length
> > files, without copying the contents.
> > 
> > $ adt-virt-qemu adt-sid.img 
> > ok
> > open
> > ok /tmp/adt-run.UrjlcT
> > print-execute-command
> > ok /tmp/adt-virt-qemu.ochiuli_/runcmd
> 
> When you are at this step, can you try to call e. g.
> 
>   /tmp/adt-virt-qemu.ochiuli_/runcmd whoami
> 
> you should get "root" and exit status 0. Does that part work?

Yep, this is indeed working.

> > copydown /etc/passwd /tmp/foo
> > ok
> > 
> > But:
> > /tmp/adt-virt-qemu.ochiuli_/runcmd ls -l /tmp/foo
> > -rw-r--r-- 1 root root 0 Jul 21 19:58 /tmp/foo
> > 
> > So the file is created, but zero-length. Has anyone seen this before? Is
> > it due to some missing dependencies (I have a custom built kernel)? I
> > have 9p and 9pnet_virtio built as modules.
> 
> The first thing that comes to my mind is that runcmd calls an internal
> helper script "eofcat" that it installs into the VM overlay. That
> needs python3 or python; if neither is present, this would fail. can
> you check that in your VM? If that's it, I'll see to providing a
> proper error message.

$ /tmp/adt-virt-qemu.5vfew9o7/runcmd python --version
sh: 42: python: not found
$ /tmp/adt-virt-qemu.5vfew9o7/runcmd python3 --version
sh: 43: python3: not found
$ /tmp/adt-virt-qemu.5vfew9o7/runcmd dpkg -l | grep py
$

So indeed this seems to be a problem. Note that I created the image via
the recommended method in adt-virt-qemu's man page (vmdebootstrap), but
it looks like the adt-setup-vm doesn't install python, so maybe there
are two bugs here. Hmm, further investigation reveals that my image uses
an invalid proxy (short "proxy"), which resolves on my real machine but
not on the NATed QEMU machine (without the full domain).

Anyway, I installed python and pyton3 packages, and the copydown command
still creates only zero-lenght files. Given this:

adt-virt-qemu: DBG: executing copydown /etc/passwd /tmp/bar
adt-virt-qemu: DBG: ['cmdls', "(['cat'], ['/tmp/adt-virt-qemu.ok1cv355/runcmd', 'sh', '-ec', 'cat >/tmp/bar'])"]
adt-virt-qemu: DBG: ['srcstdin', "<_io.TextIOWrapper name='/etc/passwd' mode='r' encoding='UTF-8'>", 'deststdout', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'>", 'devnull_read', <_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'>]
adt-virt-qemu: DBG:  +< cat
adt-virt-qemu: DBG:  +> /tmp/adt-virt-qemu.ok1cv355/runcmd sh -ec cat >/tmp/bar
adt-virt-qemu: DBG:  +>?
adt-virt-qemu: DBG:  +<?

I don't see the source file name anywhere - should it be an argument to
cat?

thanks!
iustin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20140722/3a2ef975/attachment.sig>


More information about the autopkgtest-devel mailing list