network_device_info script should be able to show all the network devices from udev

Bug #1517711 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Critical
Sylvain Pineau

Bug Description

The network_device_info script should be able to detect all of the networking devices from udev output, and tester will be able to know there is a difference between the udev output and the network manager. However, this did not happen on ROUM3-DVT2-C2 as reported in comment 6 of bug 1517312

udev result for ROUM3-DVT2-C2:
path: /devices/pci0000:00/0000:00:1c.2/0000:03:00.0
bus: pci
category: NETWORK
product_id: 33128
vendor_id: 4332
subproduct_id: 1804
subvendor_id: 4136
product: RTL8111/8168 PCI Express Gigabit Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.

u@ROUM3-DVT2-C2:~$ cd /usr/lib/2013.com.canonical.certification\:checkbox/bin/ && ./network_device_info
---------------------------[ Devices found by udev ]----------------------------
Category: WIRELESS
Interface: wlan0
Vendor: Intel Corporation
Driver: iwlwifi (ver: 3.19.0-30-generic)
Path: /devices/pci0000:00/0000:00:1c.3/0000:04:00.0

----------------------[ Devices found by Network Manager ]----------------------
Category: WiFi
Interface: wlan0
IP: 10.101.46.68
Driver: iwlwifi (ver: 3.19.0-30-generic)
State: Activated

Related branches

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This issue cannot be reproduced on 201508-19020 (ROUM3-DVT2-C1), It looks like the difference lies within the udev output:

---------------------------[ Devices found by udev ]----------------------------
Category: NETWORK
Interface: UNKNOWN
Product: RTL8111/8168 PCI Express Gigabit Ethernet controller
Vendor: Realtek Semiconductor Co., Ltd.
Path: /devices/pci0000:00/0000:00:1c.2/0000:03:00.0

Category: WIRELESS
Interface: wlan0
Vendor: Intel Corporation
Driver: iwlwifi (ver: 3.19.0-23-generic)
Path: /devices/pci0000:00/0000:00:1c.3/0000:04:00.0

----------------------[ Devices found by Network Manager ]----------------------
Category: WiFi
Interface: wlan0
IP: 192.168.158.100
Driver: iwlwifi (ver: 3.19.0-23-generic)
State: Activated

ERROR: devices missing - udev showed 1 NETWORK devices, but NetworkManager saw 0 devices in ('Ethernet', 'Modem')

udev output from ROUM3-DVT2-C1:
path: /devices/pci0000:00/0000:00:1c.2/0000:03:00.0
bus: pci
category: NETWORK
product_id: 33128
vendor_id: 4332
subproduct_id: 1804
subvendor_id: 4136
product: RTL8111/8168 PCI Express Gigabit Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
interface: UNKNOWN

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

The root cause is the "interface", for ROUM3-DVT2-C2, there is no interface in the udev output for the Ethernet device, therefore it will be dropped in:

class UdevResult:
    def addDevice(self, device):
        if device.interface:
            udev_devices.append(device)

Changed in plainbox-provider-checkbox:
assignee: nobody → Po-Hsu Lin (cypressyew)
status: New → In Progress
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

A small patch to this issue will be adding udev devices base on the "WIRELESS" and "NETWORK" categories, as we will lookup devices in these two categories later, it's harmless to filter them at the very beginning.

  class UdevResult:
    def addDevice(self, device):
+ if device.category in ['WIRELESS', "NETWORK"]:
- if device.interface:
            udev_devices.append(device)

Tested on ROUM3-DVT2-C2, it works as expected, this script will return FAIL.
The only concern is that what's the category of a WWAN card? We will need to add its category into the list as well if it does not belongs to WIRELESS or NETWORK

As Sylavin mentioned the script works on ROUM3-DVT2-C1 is because of an extra patch in udevadm.py
<spineau> PHLin: I modified locally the udev parser
<PHLin> spineau, ah, ok
<spineau> PHLin: to create an UNKNOWN interface
<spineau> PHLin: in the udev parser, in checkbox-support
<spineau> PHLin: use locate udevadm.py
<spineau> PHLin: to find it

I think it's better to land the patch in the udev parser than the patch in the network_device_info script. As many other tests could benefit from the patch in udev parser.

Changed in plainbox-provider-checkbox:
status: In Progress → Confirmed
assignee: Po-Hsu Lin (cypressyew) → nobody
Changed in plainbox-provider-checkbox:
assignee: nobody → Sylvain Pineau (sylvain-pineau)
status: Confirmed → In Progress
importance: Undecided → Critical
milestone: none → 0.24
Pierre Equoy (pieq)
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
Pierre Equoy (pieq)
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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