Gps

These scenarios check the basic GPS functions operate correctly.

Test GPS Service Client

Description

For this scenario, you need a server and a client. This scenario checks that the server can recieve internal connections as well as external connections. This is because service geofecing acts as an internal client. Default port is 2947 but for this case, port 2948 will be use.

Scenario

Step 1: Set the following configuration in DUT0 :

set controllers gps gps0
set interfaces ethernet eth2 address 10.0.0.1/24
set service gps gps0 log-level emerg
set service gps gps0 source gps0
set service gps gps0 tcp-enable
set service gps gps0 tcp-port 2948
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 10.0.0.2/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command monitor test connection client 127.0.0.1 2948 tcp at DUT0.

Step 4: Read data from monitor session at DUT0 and check if data readed matches the following regular expressions:

\$GPRMC,(\d{6}.\d{3}),(A|V),(\d{4,5}\.\d+),(N|S),(\d{5,6}\.\d+),(E|W),([\d\.]*),([\d\.]*),(\d{6}),([^,]*),([^,]*),([A-Z])\*[0-9A-F]{2}
Show output
?WATCH={"enable":true,"json":false, "nmea": true}
{"class":"VERSION","release":"3.22","rev":"3.22","proto_major":3,"proto_minor":14}
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/pts/1","driver":"NMEA0183","activated":"2026-03-06T17:48:14.451Z","flags":1,"native":0,"bps":115200,"parity":"N","stopbits":1,"cycle":1.00}]}
{"class":"WATCH","enable":true,"json":false,"nmea":true,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
$GPRMC,120005.000,A,4035.9483,N,00342.9733,W,0.7,0.0,030325,,,A*75

Step 5: Run command monitor test connection client 10.0.0.1 2948 tcp at DUT1.

Step 6: Read data from monitor session at DUT1 and check if data readed matches the following regular expressions:

\$GPRMC,(\d{6}.\d{3}),(A|V),(\d{4,5}\.\d+),(N|S),(\d{5,6}\.\d+),(E|W),([\d\.]*),([\d\.]*),(\d{6}),([^,]*),([^,]*),([A-Z])\*[0-9A-F]{2}
Show output
?WATCH={"enable":true,"json":false, "nmea": true}
{"class":"VERSION","release":"3.22","rev":"3.22","proto_major":3,"proto_minor":14}
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/pts/1","driver":"NMEA0183","activated":"2026-03-06T17:48:14.652Z","flags":1,"native":0,"bps":115200,"parity":"N","stopbits":1,"cycle":1.00}]}
{"class":"WATCH","enable":true,"json":false,"nmea":true,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
$GPGLL,4035.9483,N,00342.9733,W,120005.000,A,A*42
$PQSOL,1,2025,3,3,15,18,0,520700,2356,141498000,2,40599139,-3716222,81342,81342,37,-10,0,38,7086,-66,34,0,0,0,18126,4800,9939,897,601,912,10,10,10,0,0,0*53
$GPGGA,120006.000,4035.8483,N,00342.8983,W,1,08,1.2,650.0,M,50.0,M,,*4C
$GPRMC,120006.000,A,4035.8483,N,00342.8983,W,0.7,0.0,030325,,,A*73

Test GPS Service Position

Description

For this scenario, you just need a server. This scenario checks that operational command service gps gps0 position works as expected.

Scenario

Step 1: Set the following configuration in DUT0 :

set controllers gps gps0
set interfaces ethernet eth2 address 10.0.0.1/24
set service gps gps0 log-level emerg
set service gps gps0 source gps0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Run command service gps gps0 position at DUT0 and check if output matches the following regular expressions:

Latitude: \d{1,2}°\d{1,2}'\d{1,2}\.\d{1,2}"(N|S) Longitude: \d{1,2}°\d{1,2}'\d{1,2}\.\d{1,2}"(W|E)
Show output
Latitude: 40°35'56.90"N Longitude: 3°42'58.40"W

Test GPS Service TCP Status

Description

For this scenario, you need a server and an external client. This scenario checks that operational command service gps gps0 tcp status works as expected.

Scenario

Step 1: Set the following configuration in DUT0 :

set controllers gps gps0
set interfaces ethernet eth2 address 10.0.0.1/24
set service gps gps0 log-level emerg
set service gps gps0 source gps0
set service gps gps0 tcp-enable
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 10.0.0.2/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command monitor test connection client 10.0.0.1 2947 tcp at DUT1.

Step 4: Run command service gps gps0 status tcp at DUT0 and check if output matches the following regular expressions:

\s+TCP Client: \d+\n\s+IP Addr:10.0.0.2\n\s+Port:\d+
Show output
Remote GPS state for instance gps0: OPEN          port:2947
TCP Client: 1
  IP Addr:127.0.0.1
  Port:46090

TCP Client: 2
  IP Addr:10.0.0.2
  Port:43546

Test GPS Service Synchronize Clock

Description

For this scenario, you need a just a server. This scenario verifies that the system clock is correctly synchronized with the data provided by GPS data.

Scenario

Step 1: Set the following configuration in DUT0 :

set controllers gps gps0
set interfaces ethernet eth2 address 10.0.0.1/24
set service gps gps0 log-level emerg
set service gps gps0 source gps0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Run command set date gps gps0 at DUT0 and check if output contains the following tokens:

Date updated succefully
Show output
Date updated succefully

Step 3: Run command show date at DUT0 and expect this output:

Show output
Mon 03 Mar 2025 12:00:05 +00:00