Skip to content

mmrs: integration tests #407

@cachebag

Description

@cachebag

add integration tests for mmrs, following the nmrs pattern.

test macros

macro_rules! require_modemmanager {
    () => {
        if !is_modemmanager_available().await {
            eprintln!("skipping: modemmanager not available");
            return;
        }
    };
}

macro_rules! require_modem {
    ($mm:expr) => {
        if $mm.list_modems().await?.is_empty() {
            eprintln!("skipping: no modem available");
            return;
        }
    };
}

test cases

  • test_modemmanager_initialization — connect to mm d-bus
  • test_list_modems — enumerate modems
  • test_modem_properties — read manufacturer, model, imei
  • test_sim_properties — read iccid, imsi, operator (if sim present)
  • test_signal_quality — read signal strength
  • test_bearer_lifecycle — create, connect, disconnect, delete (needs real modem or mock)

mock modem

modemmanager supports virtual modems for testing. look into mmcli --test or libmm-glib test fixtures.

alternatively, skip bearer tests without hardware and just test the proxy/model layers.

hardware tests

for real modem testing, document the setup (sim with data plan, apn config). these would be #[ignore] by default and run manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestmmrsmodemmanager bindings cratetestsAdd, remove or adjust tests

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions