Ejemplo n.º 1
0
async def test_start():
    global station, infos, muxs, sim, timeout
    infos = tu.Infos()
    muxs = TestMuxs()
    sim = su.LgwSimServer()
    await infos.start_server()
    await muxs.start_server()
    await sim.start_server()

    station_args = ['station', '-p', '--temp', '.']
    station = await subprocess.create_subprocess_exec(*station_args)

    asyncio.ensure_future(timeout())
    with open("./gps.fifo", "wb", 0) as f:
        # Send an NMEA sentence every 1sec
        # These are not used to sync time in any way - they are only indicative of
        # having a fix and being able to produce a PPS signal
        with open("./cmd.fifo", "wb", 0) as c:
            await asyncio.sleep(1.0)
            for i in range(30):
                print('Writing GPGGA...')
                fixquality = (i & 4) * 2  # 4x 0 then 4x 2
                f.write(
                    nmea_cksum(
                        b'GPGGA,165848.000,4714.7671,N,00849.8387,E,%d,9,1.01,480.0,M,48.0,M,0000,0000'
                        % fixquality))
                print('Writing cmd.fifo...')
                c.write(b'{"msgtype":"alarm","text":"CMD test no.%d"}\n' %
                        (i, ))
                await asyncio.sleep(1)
    if muxs.tscnt > 0:
        await muxs.testDone(0)

    print('No 2nd volley of timesync messages')
    await muxs.testDone(1)
Ejemplo n.º 2
0
async def test_start():
    global station, infos, muxs, sim, timeout
    infos = tu.Infos()
    muxs = TestMuxs()
    sim = su.LgwSimServer()
    await infos.start_server()
    await muxs.start_server()
    await sim.start_server()

    station_args = ['station', '-p', '--temp', '.']
    station = await subprocess.create_subprocess_exec(*station_args)

    asyncio.ensure_future(timeout())
    with open("./gps.fifo", "wb", 0) as f:
        with open("./cmd.fifo", "wb", 0) as c:
            await asyncio.sleep(1.0)
            for i in range(20):
                logger.debug('Writing GPGGA...')
                fixquality = (i & 4) * 2  # 4x 0 then 4x 2
                lat = b'00849.8387' if i & 1 else b'00848.8387'
                f.write(
                    nmea_cksum(
                        b'GPGGA,165848.000,4714.7671,N,%s,E,%d,9,1.01,480.0,M,48.0,M,0000,0000'
                        % (lat, fixquality)))
                logger.debug('Writing cmd.fifo...')
                c.write(b'{"msgtype":"alarm","text":"CMD test no.%d"}\n' %
                        (i, ))
                await asyncio.sleep(1)
    notok = 1
    logger.debug('gpscnt=%d gpsmove=%d gpsnofix=%d cmdcnt=%d' %
                 (muxs.gpscnt, muxs.gpsmove, muxs.gpsnofix, muxs.cmdcnt))
    if muxs.gpscnt >= 1 and muxs.gpsmove >= 1 and muxs.gpsnofix >= 1 and muxs.cmdcnt >= 15:
        notok = 0
    await muxs.testDone(notok)
Ejemplo n.º 3
0
async def test_start():
    global station, infos, muxs, sim
    infos = tu.Infos()
    muxs = TestMuxs()
    sim = su.LgwSimServer()

    await infos.start_server()
    await muxs.start_server()
    await sim.start_server()

    # 'valgrind', '--leak-check=full',
    station_args = ['station', '-p', '--temp', '.']
    station = await subprocess.create_subprocess_exec(*station_args)
Ejemplo n.º 4
0
async def test_start():
    global station, infos, muxs
    infos = tu.Infos()
    muxs = TestMuxs()
    sim = su.LgwSimServer()
    await infos.start_server()
    await muxs.start_server()
    await sim.start_server()

    station_args = ['station', '-p', '--temp', '.']
    station = await subprocess.create_subprocess_exec(*station_args)

    asyncio.ensure_future(timeout())