summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgpsfake1
-rw-r--r--gpsfake.xml34
-rwxr-xr-xregress-driver2
3 files changed, 22 insertions, 15 deletions
diff --git a/gpsfake b/gpsfake
index dbad354d..8dbeeff8 100755
--- a/gpsfake
+++ b/gpsfake
@@ -114,6 +114,7 @@ if __name__ == '__main__':
for (switch, val) in options:
if (switch == '-1'):
singleshot = True
+ elif (switch == '-f'):
port = fakeport()
elif (switch == '-b'):
progress = True
diff --git a/gpsfake.xml b/gpsfake.xml
index 25fe7670..b611bd61 100644
--- a/gpsfake.xml
+++ b/gpsfake.xml
@@ -25,6 +25,7 @@ BSD terms apply: see the file COPYING in the distribution root for details.
<arg choice='opt'>-1</arg>
<arg choice='opt'>-h</arg>
<arg choice='opt'>-b</arg>
+ <arg choice='opt'>-f</arg>
<arg choice='opt'>-c <replaceable>interval</replaceable></arg>
<arg choice='opt'>-i</arg>
<arg choice='opt'>-D <replaceable>debuglevel</replaceable></arg>
@@ -73,38 +74,43 @@ is run in background.</para>
than repeatedly. This option is intended to facilitate regression
testing.</para>
-<para>The -b option enables a twirling-baton progress indicator
+<para>The <option>-b</option> enables a twirling-baton progress indicator
on standard error. At termination, it reports elapsed time.</para>
-<para>The -c option sets the delay between sentences in
+<para>The <option>-c</option> sets the delay between sentences in
seconds. Fractional values of seconds are legal. The default is zero
(no delay).</para>
-<para>The -l option makes the program dump a line or packet number
+<para>The <option>-l</option> makes the program dump a line or packet number
just before each sentence is fed to the daemon. If the sentence is
textual (e.g. NMEA), the text is dumped as well. If not, the packet
will be dumped in hexadecimal (except for RTCM packets, which aren't
dumped at all). This option is useful for checking that gpsfake is
getting packet boundaries right.</para>
-<para>The -i option is for single-stepping through logfiles. It dumps
+<para>The <option>-i</option> is for single-stepping through logfiles. It dumps
the line or packet number (and the sentence if the protocol is
textual) followed by "? ". Only when the user keys Enter is the line
actually fed to <application>gpsd</application>.</para>
-<para>The -m option specifies a monitor program inside which the
+<para>The <option>-m</option> specifies a monitor program inside which the
daemon should be run. This option is intended to be used with
<citerefentry><refentrytitle>valgrind</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>
and similar programs.</para>
-<para>The -g option uses the monitor facility to run the
+<para>The <option>-g</option> uses the monitor facility to run the
<application>gpsd</application> instance within gpsfake under control
of gdb.</para>
-<para>The -o option specifies options to pass to the daemon. The -n
+<para>The <option>-f</option> configures <application>gpsd</application> to bind
+to a random dynamic/private port (range 49152 - 65535). Its main use
+is within regression-test scripts so they won't collide with a production
+instance.</para>
+
+<para>The <option>-o</option> specifies options to pass to the daemon. The -n
option passes -n to start the daemon reading the GPS without waiting
-for a client (equivalent to -o "-n"). The -D option passes a -D
+for a client (equivalent to -o "-n"). The <option>-D</option> passes a -D
option to the daemon: thus -D 4 is shorthand for -o "-D 4".</para>
<para>The -p ("pipe") option sets watcher mode and dumps the NMEA and GPSD
@@ -113,25 +119,25 @@ for regression-testing.</para>
<para>The -P ("port") option sets the daemon's listening port.</para>
-<para>The -r option specifies an initialization command to use in pipe mode.
+<para>The <option>-r</option> specifies an initialization command to use in pipe mode.
The default is <command>?WATCH={"enable":true,"json":true}</command>.</para>
-<para>The -s option sets the baud rate for the slave tty. The
+<para>The <option>-s</option> sets the baud rate for the slave tty. The
default is 4800.</para>
-<para>The -u option forces the test framework to use UDP rather than
+<para>The <option>-u</option> forces the test framework to use UDP rather than
pty devices. This may be useful for testing from within chroot jails
where access to pty devices is locked out.</para>
-<para>The -v option enables verbose progress reports to stderr. It is
+<para>The <option>-v</option> enables verbose progress reports to stderr. It is
mainly useful for debugging <application>gpsfake</application>
itself.</para>
-<para>The -x option dumps packets as
+<para>The <option>-x</option> dumps packets as
<application>gpsfake</application> gathers them. It is mainly useful
for debugging <application>gpsfake</application> itself.</para>
-<para>The -h option makes <application>gpsfake</application> print
+<para>The <option>-h</option> makes <application>gpsfake</application> print
a usage message and exit.</para>
<para>The argument must be the name of a file containing the
diff --git a/regress-driver b/regress-driver
index fe080e38..a404e4c1 100755
--- a/regress-driver
+++ b/regress-driver
@@ -105,7 +105,7 @@ case $mode in
then
trap 'rm -f ${TMP}/test-$$.chk; exit $errors' EXIT HUP INT TERM
case $testing in
- daemon) ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ${ALTFILTER} >${TMP}/test-$$.chk ;;
+ daemon) ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -f -1 -p $opts ${f} | ${GPSFILTER} ${ALTFILTER} >${TMP}/test-$$.chk ;;
clientlib) ${GPSD_HOME}/test_libgps -b <${f} >${TMP}/test-$$.chk ;;
esac
if [ "${ALTFILTER}" ]