test_modem.py 584 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
import subprocess


def test_modem_usb():
    "Test if the modem is visible on the USB bus"
    out = subprocess.check_output(["lsusb", "-d", "1e0e:9001"])
    assert(b"Qualcom" in out)


def test_modem_modem_manager():
    "Test if modem manager picked up the modem"
    out = subprocess.check_output(["mmcli", "-m", "0"])
    assert(b"model: SIMCOM_SIM7100" in out)
14 15 16 17 18 19 20


def test_modem_alsa():
    "Test if the modem is seen by alsa"
    out = subprocess.run(["aplay", "-l"], capture_output=True)
    assert(out.returncode == 0)
    assert(b": SIM7100 [SIMCom SIM7100]" in out.stdout)