Bug#801209: autopkgtest: adt-setup-vm tries to use host's network interface name

Christian Seiler christian at iwakd.de
Wed Oct 7 13:24:54 UTC 2015


Package: autopkgtest
Version: 3.17.2
Severity: normal
Tags: patch

Dear Maintainer,

adt-setup-vm tries to use the host's network interface name when called
from e.g. vmdebootstrap. Especially if the recommended command in the
man page of adt-virt-qemu is used, this is problematic.

Offending lines in adt-setup-vm:

if OUT="$(cd /sys/class/net; ls -d e* 2>/dev/null)"; then
  IFACE="${OUT# *}"
  ...
fi

/sys/class/net is here that of the host, because the VM isn't booted
yet.

I've attached a patch that does the following:

 - if $root is /, so this is run inside a VM, keep the old code
 - otherwise, assume it's eth0. This is fine up to Jessie inside the
   VM, but newer udev versions will use "predictable names", which in
   case of VMs I'm not completely sure are that predictable. (In my
   case it's always ens3 for adt-virt-qemu, but I'm not sure how stable
   that is across QEMU impolementations.) Therefore, do the same thing
   here that autopkgtest does if called with --enable-dhcp, i.e. mask
   80-net-setup-link.rules to keep the kernel names.

Note that after masking any udev rule, one needs to update the
initramfs, but vmdebootstrap at least does that after calling the
customization script, so we don't do that here. (If run inside a VM, we
don't mask the udev rule, so we don't need this.)

Regards,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-adt-setup-vm-Don-t-use-host-interface-name-in-a-VM.patch
Type: text/x-diff
Size: 2181 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20151007/f6c4211e/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20151007/f6c4211e/attachment.sig>


More information about the autopkgtest-devel mailing list