2 # This test simulates interaction with GoodStuff hardware for the purpose
3 # of RFID scanning a patron card. The hardware is capable of fielding
4 # multiple such cards in one pass, but the staff client will close the
5 # connection after the first successful card.
9 # Requires expect and netcat to be installed, and expects for a pristine
10 # load of EG's stock test data to be installed. In the staff client,
11 # pv_supa_goodstuff should be listed in the Add-Ons list under Admin ->
12 # Workstation Administration -> Server Add-ons. In the GoodStuff
13 # preferences section, Enabled should be checked, the IP/Hostname field
14 # should point to the server running this test script, and the port
15 # should be 5000. Networking should be configured to allow the client
16 # machine to reach port 5000 on this server. If netcat is not installed
17 # as /bin/nc, change the spawn line below as appropriate.
21 # 1) Ensure the staff client is configured as per the prerequisites, and
22 # clear all tabs in the staff client.
23 # 2) Invoke this script.
24 # 3) In the staff client, press F1 or invoke Circulation -> Checkout
25 # Items. If the RFID checkbox is unchecked, check it.
26 # 4) The script should run without errors, and the staff client should
27 # show an attempt at loading a patron with card "bad_card", and then
28 # the patron with card "99999376669" should load. The script should
32 proc send {ignore arg} {
37 spawn "/bin/nc/" -l -p 5000
39 expect "START|PATRON\r"
41 expect -exact "START|OK\r
44 expect -exact "bad_card\r
47 send -- "99999376669\r"
48 expect -exact "99999376669\r