probe_cellular_info

Source code: probe_cellular_info.py

Probes information from /org/freedesktop/ModemManager1.

Description

This test can probe requested data, including NAME={'imei', 'meid', 'lte_imei', 'lte_iccid'} from /org/freedesktop/ModemManager1. When the argument probe_{NAME} is set True, the data NAME will be logged and saved to device data.

The fields argument is a dictionary containing multiple (NAME, FIELD) pairs. It will override the following default fields:

NAME

FIELD

probe_{NAME}

imei

imei

True

meid

meid

True

lte_imei

Imei

False

lte_iccid

SimIdentifier

False

Test Procedure

This is an automated test without user interaction.

The test will probe specific data from /org/freedesktop/ModemManager1, then log to cros.factory.testlog and save to cros.factory.test.device_data.

Dependency

Some modems may have different identities for each fields. For example, Fibocom LTE module will identify imei as EquipmentIdentifier, so you will need to specify the fields argument.

Examples

The following argument will probe imei from field EquipmentIdentifier:

{
  "pytest_name": "probe_cellular_info",
  "label": "Probe Cellular Info",
  "related_components": [
    "test_tags.TestCategory.WWAN"
  ],
  "args": {
    "probe_imei": true,
    "probe_meid": false,
    "probe_lte_imei": false,
    "probe_lte_iccid": false,
    "fields": {
      "imei": "EquipmentIdentifier"
    }
  }
}

Example output:

# "factory device-data" output before this test
serials:
  serial_number: 12345678

# "factory device-data" output after this test
component:
  cellular:
    imei: '862227050001326'
serials:
  serial_number: 12345678

Test Arguments

Name

Type

Description

probe_imei

bool

(optional; default: True) Whether to probe IMEI

probe_meid

bool

(optional; default: True) Whether to probe MEID

probe_lte_imei

bool

(optional; default: False) Whether to probe IMEI on LTE modem

probe_lte_iccid

bool

(optional; default: False) Whether to probe ICCID on LTE SIM card

fields

dict

(optional; default: {}) Specify the fields to probe. A {NAME: FIELD} pair will record thevalue of FIELD to KEY_COMPONENT.cellular.NAME