Index: src/gnuboat/device/tests/__init__.py
===================================================================
--- src/gnuboat/device/tests/__init__.py	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
+++ src/gnuboat/device/tests/__init__.py	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
@@ -0,0 +1,16 @@
+'''
+    Copyright (C) 2020 EngSaS - Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+'''
Index: src/gnuboat/device/tests/conftest.py
===================================================================
--- src/gnuboat/device/tests/conftest.py	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
+++ src/gnuboat/device/tests/conftest.py	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
@@ -0,0 +1,55 @@
+'''
+    Copyright (C) 2020 EngSaS - Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+'''
+
+import pytest
+from werkzeug.utils import import_string
+import time
+
+from gnuboat.common.webservice.Config import (
+    config_get
+)
+
+
+@pytest.fixture(scope='session')
+def configuration():
+    return import_string('gnuboat.device.Config.TestingConfig')
+
+
+@pytest.fixture(scope='module')
+def gps_fake(configuration):
+    """
+        Supplies a GPS Fake instance and cleans it up after the test ends.
+        To use it, you need to
+        1. add a gps fake device testsession.gps_add(logfile)
+        2. connect a gps client to it
+        3. call testsession.start()
+    """
+    from gps.fake import TestSession
+    # timeout is needed, so that the gpsfake session (aka TestSession.run)
+    # is ended shortly after the fakelog has been at the end
+    testsession = TestSession(
+        port=int(config_get(configuration, 'GPSD_PORT', 2947)),
+        options="", verbose=0, timeout=1)
+    testsession.spawn()
+    yield testsession
+    try:
+        testsession.cleanup()
+    except gps.fake.TestSessionError as e:
+        if e.message == 'daemon died':
+            pass
+        else:
+            raise e
Index: src/gnuboat/device/tests/data/gpsfake-1.log
===================================================================
--- src/gnuboat/device/tests/data/gpsfake-1.log	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
+++ src/gnuboat/device/tests/data/gpsfake-1.log	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
@@ -0,0 +1,10 @@
+$GNRMC,092806,A,4736.0848,N,01043.0403,E,01.1,207.7,110819,,,A*5A
+$GNRMC,092808,A,4736.0837,N,01043.0392,E,01.1,211.3,110819,,,A*50
+$GNRMC,092810,A,4736.0826,N,01043.0383,E,01.2,210.7,110819,,,A*5F
+$GNRMC,092812,A,4736.0814,N,01043.0375,E,01.3,204.9,110819,,,A*5F
+$GNRMC,092814,A,4736.0801,N,01043.0372,E,01.1,193.6,110819,,,A*5A
+$GNRMC,092816,A,4836.0789,N,01043.0370,E,01.1,189.9,110819,,,A*51
+$GNRMC,092818,A,4736.0775,N,01043.0365,E,01.1,193.8,110819,,,A*52
+$GNRMC,092820,A,4736.0763,N,01043.0357,E,01.2,203.8,110819,,,A*56
+$GNRMC,092822,A,4736.0751,N,01043.0348,E,01.2,208.0,110819,,,A*58
+$GNRMC,092824,A,4736.0741,N,01043.0335,E,01.3,218.4,110819,,,A*51
Index: src/gnuboat/device/tests/test_gpsd_poller.py
===================================================================
--- src/gnuboat/device/tests/test_gpsd_poller.py	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
+++ src/gnuboat/device/tests/test_gpsd_poller.py	(revision ae77cef0fcdf9902acaf2e9979ce0013e8a25dce)
@@ -0,0 +1,168 @@
+'''
+    Copyright (C) 2020 EngSaS - Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+'''
+
+import pytest
+import os
+import threading
+import datetime
+import time
+import math
+import pytz
+
+from gnuboat.device.daemon import gpsdpoller
+from gnuboat.common.webservice.Config import (
+    config_get
+)
+
+
+def fakehook(linenumber, fakegps):
+    """
+        Used as pred for gps fake device,
+        and indicates, when the device is ready
+        to generate data
+    """
+    if not fakegps.testload.sentences:
+        sys.stderr.write("fakegps: no sentences in test load.\n")
+        raise SystemExit(1)
+    if linenumber % len(fakegps.testload.sentences) == 0:
+        if linenumber > 0:
+            return False
+    time.sleep(1)
+    return True
+
+
+def parse_datetime(nmea_datetime):
+    return pytz.utc.localize(
+        datetime.datetime.strptime(nmea_datetime, '%d%m%y %H%M%S'))
+
+
+def assert_custom(result, error_text, gps_client):
+    if not result:
+        gps_client.stop()
+        gps_client.join()
+    assert result, error_text
+
+
+@pytest.mark.sitepackages
+@pytest.mark.parametrize(
+    'gps_logfile, results', [
+        (
+            os.path.join(os.path.dirname(__file__), 'data/gpsfake-1.log'),
+            {
+                '110819092806': {
+                    'latitude': 47.601413, 'longitude': 10.717338,
+                    'datetime': parse_datetime('110819 092806'),
+                },
+                '110819092808': {
+                    'latitude': 47.601395, 'longitude': 10.717320,
+                    'datetime': parse_datetime('110819 092808'),
+                },
+                '110819092810': {
+                    'latitude': 47.601376, 'longitude': 10.717305,
+                    'datetime': parse_datetime('110819 092810'),
+                },
+                '110819092812': {
+                    'latitude': 47.601356, 'longitude': 10.717293,
+                    'datetime': parse_datetime('110819 092812'),
+                },
+                '110819092814': {
+                    'latitude': 47.601335, 'longitude': 10.717286,
+                    'datetime': parse_datetime('110819 092814'),
+                },
+                '110819092816': {
+                    'latitude': 47.601315, 'longitude': 10.717283,
+                    'datetime': parse_datetime('110819 092816'),
+                },
+                '110819092818': {
+                    'latitude': 47.601293, 'longitude': 10.717276,
+                    'datetime': parse_datetime('110819 092818'),
+                },
+                '110819092820': {
+                    'latitude': 47.601271, 'longitude': 10.717261,
+                    'datetime': parse_datetime('110819 092820'),
+                },
+                '110819092822': {
+                    'latitude': 47.601251, 'longitude': 10.717246,
+                    'datetime': parse_datetime('110819 092822'),
+                },
+                '110819092824': {
+                    'latitude': 47.601235, 'longitude': 10.717226,
+                    'datetime': parse_datetime('110819 092824'),
+                },
+            }
+        )
+    ]
+)
+def test_gpsdpoller(configuration, gps_fake, gps_logfile, results):
+    gps_fake.gps_add(
+        gps_logfile, pred=fakehook,
+        speed=4800, oneshot=True)
+    ready_event = threading.Event()
+    gps_client = gpsdpoller.GpsdPoller(
+        port=int(config_get(configuration, 'GPSD_PORT', 2947)),
+        ready_event=ready_event)
+    gps_client.start()
+    ready_event.wait(10)
+    thread = threading.Thread(target=gps_fake.run)
+    thread.start()
+
+    found = []
+    while thread.is_alive():
+        if gps_client.status() == 'A':
+            latitude = gps_client.latitude()
+            longitude = gps_client.longitude()
+            fix = gps_client.gps_fix()
+            gps_time = gps_client.time_utc()
+            key = gps_time.strftime('%d%m%y%H%M%S')
+            if key in results:
+                assert_custom(
+                    math.isclose(
+                        longitude, results[key]['longitude'], rel_tol=1e-6
+                    ),
+                    'Wrong longitude {} vs. {}'.format(
+                        longitude, results[key]['longitude']
+                    ), gps_client
+                )
+                assert_custom(
+                    math.isclose(
+                        latitude, results[key]['latitude'], rel_tol=1e-6
+                    ),
+                    'Wrong latitude {} vs. {}'.format(
+                        latitude, results[key]['latitude']
+                    ), gps_client
+                )
+                assert_custom(fix >= 2, 'No fix, where expected', gps_client)
+                assert_custom(
+                    gps_time == results[key]['datetime'],
+                    'Wrong time {} vs {}'.format(
+                        gps_client.time_utc().isoformat('T'),
+                        results[key]['datetime'].isoformat('T')
+                    ), gps_client
+                )
+                if key not in found:
+                    found.append(key)
+        time.sleep(0.25)
+    missed = abs(len(results) - len(found))
+    assert_custom(
+        missed < 2,
+        'Missed {} out of {} messages'.format(missed, len(results)),
+        gps_client
+    )
+
+    gps_fake.cleanup()
+    gps_client.stop()
+    gps_client.join()
