def METHOD_NAME(gg, ope, stlpc, known_path, comports,
                                          globs, expected):
    gg.return_value = globs
    ope.return_value = known_path
    if comports:
        fake_comport1 = serial.tools.list_ports_common.ListPortInfo(
                '/dev/ttyACM1')
        fake_comport1.interface = 'something'
        fake_comport2 = serial.tools.list_ports_common.ListPortInfo(
                '/dev/ttyACM2')
        fake_comport2.interface = None
        fake_comport3 = serial.tools.list_ports_common.ListPortInfo(
                '/dev/ttyACM3')
        fake_comport3.interface = blackmagicprobe.BMP_GDB_INTERFACE
        stlpc.return_value = [fake_comport1, fake_comport2, fake_comport3]
    else:
        stlpc.return_value = []
    ret = blackmagicprobe.blackmagicprobe_gdb_serial_linux()
    assert expected == ret