python-API test in ubuntu_lxc will fail on X-kvm kernel

Bug #1764618 reported by Po-Hsu Lin on 2018-04-17
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Undecided
Unassigned
python3-lxc (Ubuntu)
Undecided
You-Sheng Yang

Bug Description

Steps:
  1. Deploy a KVM node with Xenial, install linux-kvm on it
  2. Run the ubutnu_lxc test from autotest-client-tests

Output:
  FAIL: python3: API
  ---
  Using image from local cache
  Unpacking the rootfs

  ---
  You just created an Ubuntu container (release=xenial, arch=amd64, variant=default)

  To enable sshd, run: apt-get install openssh-server

  For security reason, container images ship without user accounts
  and without a root password.

  Use lxc-attach or chroot directly into the rootfs to set a root password
  or create user accounts.
  Getting instance for '785bd96e-41ef-11e8-a707-5254004f0f0f'
  Creating rootfs using 'download', arch=amd64
  Testing the configuration
  Testing the networking
  Starting the container
  Getting the interface names
  Traceback (most recent call last):
    File "/tmp/tmp.jDauiqznXt", line 109, in <module>
      assert(set(container.get_interfaces()) == set(('lo', 'eth0')))
  AssertionError

If you try to intercept the ontainer.get_interfaces() result, you'll see:
('eth0', 'lo', 'sit0')

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-4.4.0-1021-kvm 4.4.0-1021.26
ProcVersionSignature: User Name 4.4.0-1021.26-kvm 4.4.117
Uname: Linux 4.4.0-1021-kvm x86_64
ApportVersion: 2.20.1-0ubuntu2.16
Architecture: amd64
Date: Tue Apr 17 03:46:14 2018
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: linux-kvm
UpgradeStatus: No upgrade log present (probably fresh install)

Po-Hsu Lin (cypressyew) wrote :
Po-Hsu Lin (cypressyew) wrote :

ip addr output from the KVM host:

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:4f:0f:0f brd ff:ff:ff:ff:ff:ff
    inet 10.246.72.55/22 brd 10.246.75.255 scope global ens4
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe4f:f0f/64 scope link
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
4: lxcbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 10.0.3.1/24 scope global lxcbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe00:0/64 scope link
       valid_lft forever preferred_lft forever
86: veth33NLN2@if85: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxcbr0 state UP group default qlen 1000
    link/ether fe:c0:8a:bd:42:23 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::fcc0:8aff:febd:4223/64 scope link
       valid_lft forever preferred_lft forever
88: vethMH25TY@if87: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxcbr0 state UP group default qlen 1000
    link/ether fe:d8:c8:86:12:a8 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::fcd8:c8ff:fe86:12a8/64 scope link
       valid_lft forever preferred_lft forever
90: veth4J6PQB@if89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxcbr0 state UP group default qlen 1000
    link/ether fe:f5:f0:d6:ba:ac brd ff:ff:ff:ff:ff:ff link-netnsid 2
    inet6 fe80::fcf5:f0ff:fed6:baac/64 scope link
       valid_lft forever preferred_lft forever

description: updated
Po-Hsu Lin (cypressyew) on 2019-09-16
tags: added: ubuntu-lxc
You-Sheng Yang (vicamo) on 2019-09-16
Changed in linux-kvm (Ubuntu):
assignee: nobody → You-Sheng Yang (vicamo)
You-Sheng Yang (vicamo) wrote :

Confirmed with 4.4.0-1056-kvm kernel. Failed program:

## Python3 testsuite
STRING="python3: API"
if [ ! -f /usr/share/doc/python3-lxc/examples/api_test.py.gz ]; then
    ignore "$STRING"
else
    OUT=$(mktemp)

    PYTEST=$(mktemp)
    cat /usr/share/doc/python3-lxc/examples/api_test.py.gz | gzip -d > $PYTEST
    python3 $PYTEST >$OUT 2>&1 && pass "$STRING" || \
        fail "$STRING" "python3" "$OUT"
    rm $PYTEST

    rm $OUT
fi

You-Sheng Yang (vicamo) wrote :

CONFIG_E1000, driver for ethernet, is not enabled in kvm kernel.

You-Sheng Yang (vicamo) wrote :

CONFIG_ETHERNET itself is not turned on but says 'y' in annotation.

Here is a list of supported network devices in qemu v4.1.0:

Network devices:
name "e1000", bus PCI, alias "e1000-82540em", desc "Intel Gigabit Ethernet"
name "e1000-82544gc", bus PCI, desc "Intel Gigabit Ethernet"
name "e1000-82545em", bus PCI, desc "Intel Gigabit Ethernet"
name "e1000e", bus PCI, desc "Intel 82574L GbE Controller"
name "i82550", bus PCI, desc "Intel i82550 Ethernet"
name "i82551", bus PCI, desc "Intel i82551 Ethernet"
name "i82557a", bus PCI, desc "Intel i82557A Ethernet"
name "i82557b", bus PCI, desc "Intel i82557B Ethernet"
name "i82557c", bus PCI, desc "Intel i82557C Ethernet"
name "i82558a", bus PCI, desc "Intel i82558A Ethernet"
name "i82558b", bus PCI, desc "Intel i82558B Ethernet"
name "i82559a", bus PCI, desc "Intel i82559A Ethernet"
name "i82559b", bus PCI, desc "Intel i82559B Ethernet"
name "i82559c", bus PCI, desc "Intel i82559C Ethernet"
name "i82559er", bus PCI, desc "Intel i82559ER Ethernet"
name "i82562", bus PCI, desc "Intel i82562 Ethernet"
name "i82801", bus PCI, desc "Intel i82801 Ethernet"
name "ne2k_isa", bus ISA
name "ne2k_pci", bus PCI
name "pcnet", bus PCI
name "pvrdma", bus PCI, desc "RDMA Device"
name "rocker", bus PCI, desc "Rocker Switch"
name "rtl8139", bus PCI
name "usb-bt-dongle", bus usb-bus
name "usb-net", bus usb-bus
name "virtio-net-device", bus virtio-bus
name "virtio-net-pci", bus PCI, alias "virtio-net"
name "virtio-net-pci-non-transitional", bus PCI
name "virtio-net-pci-transitional", bus PCI
name "vmxnet3", bus PCI, desc "VMWare Paravirtualized Ethernet v3"

So this would depend on following drivers (all set to 'm' in annotation):
* CONFIG_E100
* CONFIG_E1000
* CONFIG_E1000E
* CONFIG_ETHERNET
* CONFIG_NE2K_PCI
* CONFIG_NET_VENDOR_INTEL
* CONFIG_PCNET32

You-Sheng Yang (vicamo) wrote :

In Bionic or above, tests are run by autopkgtest in the lxc package. However, its control file, https://github.com/lxc/lxc-pkg-ubuntu/blob/dpm-xenial/debian/tests/control, doesn't seem to depend on python3-lxc, which follows api_test in the python3-lxc package are not tested on Bionic or above[1].

[1]: https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-eoan/eoan/amd64/l/lxc/20190917_234129_d1525@/log.gz

You-Sheng Yang (vicamo) wrote :
Changed in python3-lxc (Ubuntu):
assignee: nobody → You-Sheng Yang (vicamo)
no longer affects: linux-kvm (Ubuntu)
You-Sheng Yang (vicamo) wrote :
Changed in python3-lxc (Ubuntu):
status: New → In Progress
You-Sheng Yang (vicamo) wrote :

Some details for comment #4 and #5:

kvm nodes deployed for test was launched with virtio_net as network device, so it's actually not related to the lack of ethernet device drivers. I think enabling ethernet in kvm kernel might also be convenient for users running virtual machines because e1000 card is the default nic in qemu, but that's definitely out of the scope here.

Po-Hsu Lin (cypressyew) on 2019-09-18
Changed in ubuntu-kernel-tests:
status: New → In Progress

The attachment "0001-api_test-fix-interfaces-comparison-failure.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.