README-test
1===============================================================
2These are the test scripts and test files for the NCID server,
3gateways, clients and client output modules.
4===============================================================
5
6 If you haven't built up ncidd(server) and ncid(client),
7 do it now to be able to perform the following tests.
8
9aliasfile:
10 Used to view the cidalias array in the server. Called
11 from the ncidd-noerrors.conf file.
12
13aliasfile.errors:
14 Various alias file errors: ncidd -DA aliasfile.errors
15
16largecall.log:
17 This call logfile contains 3006 similar lines. It is used to detect
18 any dropping of characters by the client or server.
19
20large.blacklist:
21 This blacklist file contains approximately 12,000 lines. It is used
22 to detect performance issues with the ncidd server.
23
24ncidd-errors.conf:
25 Server configuration file with errors: ncidd -DC ncidd-errors.conf
26
27ncidd-noerrors.conf:
28 Server configuration file with no errors. It reads the aliasfile.
29 ncidd -Dv5 -C ncidd-noerrors.conf
30
31test-client:
32test-client.data-germany: tests country code DE
33test-client.data:
34test-client-screenshot.data:
35test-client-relay.data:
36 The test-client script is an NCID server emulator. It is used to
37 test a client. The test server uses port 3334. It sends one or more
38 lines from the test-client.data file with each press of <ENTER>.
39 The last <ENTER> will terminate the server. Blank lines are used to
40 terminate a send initiated by <ENTER>.
41
42 Change to the ./test directory before issuing the commands below.
43
44 Usage: ./test-client [data_file]
45 Default Data File: test-client.data
46 Alternate File: test-client-screenshot.data:
47
48 To test a client:
49 Start test-client (it will give instructions and send a 200 line)
50 Start the NCID client on port 3334 (it will receive the 200 line)
51 Press <ENTER> to send 1 MSG line
52 Press <ENTER> to send 5 CIDLOG lines
53 Press <ENTER> to send 1 MSG line
54 Press <ENTER> to send a CID line (there are 2 CID lines)
55 Press <ENTER> to send various combinations of CID and CIDINFO lines
56 (there a 8 CID and CIDINFO line combinations)
57 Press <ENTER> to send a CID line with a specific number of digits
58 (there are 7 CID lines)
59 Press <ENTER> to send 1 CIDINFO RING line
60 Press <ENTER> to end test-client
61
62 NOTE: test-client and test-client.data must be in the same directory
63
64testlog:
65testlog-display:
66 Testlog contains test data that is sent to clients at start.
67 It is used as the cidcall.log file.
68
69 Testlog-display is how ncid will display testlog.
70 This assumes the "1" digit is not configured to display.
71 This also assumes the display format is for the US.
72
73test-module.data:
74 A test file for ncid output modules, like ncid-page and ncid-speak.
75 To test ncid-page:
76 cat ./test/test-module.data | /usr/local/share/ncid/ncid-page
77
78 Output modules can be tested buy supplying a minimum of 6 lines of
79 input. The input lines are not error checked. They are:
80 Date
81 Time
82 Number
83 Name
84 Line Label
85 Call type
86
87test-server:
88 This script is used to test ncidd or a client. The server is
89 optioned for verbose level 3, port 3334 and either debug mode
90 or Mac OSX launchd mode. The test server can be run at the same
91 time as one in actual use.
92
93 The test-server script creates empty T-data.log and T-alias files
94 in the current directory. It also creates T-conf, T-blacklist
95 and T-whitelist files with test data. When ncidd is launched, it
96 creates T-logfile, T-pid, T-call.log files and will populate them
97 with data. Most T-* files can be modified for test-client after
98 they have been created. The T-* files can be deleted by hand or
99 "make clobber" when testing is finished.
100
101 Change to the ./test directory before issuing the commands below.
102
103 Usage: test-server {<path>/ncidd} [--osx-launchd] [<ncidd_option(s)>]
104 no options - Caller ID from a modem and optional gateways
105 --cidinput 0 | -j0 - Caller ID from a modem and optional gateways
106 --cidinput 1 | -j1 - Caller ID from a serial or USB device
107 --cidinput 2 | -j2 - Caller ID from a gateway with modem support
108 --cidinput 3 | -j3 - Caller ID from gateways without modem support
109
110 Examples: # Run test server in modem mode with verbose level 4:
111 # must use with test-modem-calls
112 ./test-server ../server/ncidd -v4
113
114 # Run test server with a Linux USB modem (second modem)
115 ./test-server ../server/ncidd -t /dev/ttyACM1 -j0
116
117 # Run test-server in launchd mode and cidinput = 3 (gateway mode)
118 ./test-server ../server/ncidd --osx-launchd
119
120test-modem-calls:
121test-modem-calls.data:
122 This script emulates the output of a modem. It is usually
123 run at the same time as test-server and ncid. It requires the
124 program 'socat' to be installed because it creates a pseudo-tty
125 that will act like a modem to ncidd.
126
127 Change to the ./test directory before issuing the commands below.
128
129 To test a server or client, start all three programs in 3 different
130 terminal windows in this order:
131 ./test-modem-calls
132 ./test-server ../server/ncidd
133 ../client/ncid 3334
134
135 Press <ENTER> to send the first line
136 Press <ENTER> to keep sending lines until script terminates
137
138 NOTE: test-modem-calls and test-modem-calls.data must be in the
139 same directory
140
141test-device-calls:
142test-device-calls.data:
143 This script emulates the output of a non-modem serial device.
144 Use this to simulate devices like the NetCallerID or multi-line
145 POTS devices like those available from the company TCI.
146 It will also emulate serial Whozz Calling devices that have the
147 output format (usually switch 7) set to ON for TCI.
148
149 This script is usually run at the same time as test-server and ncid.
150 It requires the program 'socat' to be installed because it creates a
151 pseudo-tty that will act like a serial device to ncidd.
152
153 Change to the ./test directory before issuing the commands below.
154
155 To test a server or client, start all three programs in 3 different
156 terminal windows in this order:
157 ./test-device-calls [data file]
158 ./test-server ../server/ncidd -t vdevice0 -j1
159 ../client/ncid 3334
160
161 Press <ENTER> to send the first line
162 Press <ENTER> to keep sending lines until script terminates
163
164 NOTE: test-modem-calls and test-modem-calls.data must be in the
165 same directory
166
167test-xdmf-calls:
168test-xdmf-calls.data:
169test-xdmf-ht9032-calls.data:
170 This script emulates the output of the CTI Comet USB,
171 the Holtek HT9032D based PSTN Caller ID module or other XDMF device.
172
173 This script is usually run at the same time as xdmf2ncid gateway.
174 It requires the program 'socat' to be installed because it creates a
175 pseudo-tty that will act like a serial device to xdmf2ncid gateway.
176
177 Change to the ./test directory before issuing the commands below.
178
179 To test a xdmf2ncid gateway, start both programs in 2 different
180 terminal windows in this order:
181
182 1. Launch this script:
183
184 if using HEX data:
185 ./test-xdmf-calls [-H] [<xdmf hex call file>] [...]
186 if using binary data:
187 ./test-xdmf-calls -b <xdmf binary call file>
188 if using Holtek HT9032D data:
189 ./test-xdmf-calls <xdmf ht9032 call file>
190
191 2. Connect xdmf2ncid to the tty port:
192
193 if testing Comet or modem data (default):
194 ../gateway/xdmf2ncid -t -u vdevice0 [-v5]
195 if testing Holtek HT9032D based PSTN Caller ID module:
196 ../gateway/xdmf2ncid -t -u vdevice0 -I1 [-v5]
197
198 3. Press <ENTER> multiple times to send incoming call data.
199
200 NOTE: test-xdmf-calls,test-xdmf-calls.data and test-xdmf-ht9032-calls.data
201 must be in the same directory
202
203test-gw-calls:
204test-gw-calls.data:
205test-gw-calls-screenshot.data:
206 This script emulates the generic output from a gateway. Its primary
207 use is to test the ncidd server gateway processing logic and is not
208 specific to a particular gateway device. It is usually run at the
209 same time as test-server and ncid.
210
211 Change to the ./test directory before issuing the commands below.
212
213 Usage: ./test-gw-calls [data_file]
214 Default Data File: test-gw-calls.data
215 Alternate File: test-gw-calls-screenshot.data
216
217 To test a server or client, start all three programs in 3 different
218 terminal windows in this order:
219 ./test-server ../server/ncidd
220 ./test-gw-calls
221 ../client/ncid 3334
222
223 Press <ENTER> to send the first line
224 Press <ENTER> to keep sending lines until script terminates
225
226 NOTE: test-gw-calls and test-gw-calls.data must be in the same directory
227
228test-obi-gw:
229test-obi-gw.data:
230 This script emulates the output from an Obihai device. It is
231 usually run at the same time as test-server and ncid. It requires
232 the test-obi-gw.data file be created by running obi2ncid with the
233 --rawfile-append or --rawfile-overwrite options.
234
235 Change to the ./test directory before issuing the commands below.
236
237 This script has a few more options than most of the test scripts.
238 For more info, see the manual page for test-obi-gw.
239
240 Typical usage: ./test-obi-gw [data_file]
241 or: ./test-obi-gw -n [data_file]
242 Default Data File: test-obi-gw.data
243
244 Specify the -n (--non-stop) option to send the entire test data file
245 at once. Otherwise, you'll need to press <ENTER> to send one line at
246 a time.
247
248 To test a server or client, start all four programs in 4 different
249 terminal windows in this order:
250 ./test-server ../server/ncidd
251 ./test-obi-gw
252 ../client/ncid 3334
253 ../gateway/obi2ncid -n localhost:3334 -o 4339 -Dv5
254
255 Press <ENTER> to send the first line
256 Press <ENTER> to keep sending lines until script terminates
257
258 NOTE: test-obi-gw and test-obi-gw.data must be in the same directory
259
260test-rn2ncid:
261test-rn2ncid.data:
262 This script emulates the output from the rn2ncid (Remote Notifier
263 for Android) gateway. It is usually run at the same time as
264 test-server and ncid.
265
266 Change to the ./test directory before issuing the commands below.
267
268 Usage: ./test-rn2ncid [data_file]
269 Default Data File: test-rn2ncid.data
270
271 To test a server or client, start all four programs in 4 different
272 terminal windows in this order:
273 ./test-server ../server/ncidd
274 ./test-rn2ncid
275 ../client/ncid 3334
276 ../gateway/rn2ncid -n localhost:3334 -c 10600 -D
277
278 Press <ENTER> to send the first line
279 Press <ENTER> to keep sending lines until script terminates
280
281 NOTE: test-rn2ncid and test-rn2ncid.data must be in the same directory
282
283test-sip-gw:
284test-sip-gw.data:
285 This script emulates a SIP server for testing a SIP gateway.
286
287 Change to the ./test directory before issuing the commands below.
288
289 Usage: ./test-sip-gw [data_file]
290 Default Data File: test-sip-gw.data
291 Alternate file: test-sip-gw-vonage.data
292
293 To test a SIP gateway:
294 Start test-sip2ncid (it will give instructions for sip2ncid)
295 Start the SIP gateway on port 3334
296 Press <ENTER> to send the first SIP packet
297 Press <ENTER> to keep sending packets until script terminates
298
299 NOTE: test-sip-gw and test-sip-gw.data must be in the same directory
300