2 # This test simulates interaction with GoodStuff hardware for the purpose
3 # of RFID scanning items for checkout.
7 # Requires expect and netcat to be installed, and expects for a pristine
8 # load of EG's stock test data to be installed. In the staff client,
9 # pv_supa_goodstuff should be listed in the Add-Ons list under Admin ->
10 # Workstation Administration -> Server Add-ons. In the GoodStuff
11 # preferences section, Enabled should be checked, the IP/Hostname field
12 # should point to the server running this test script, and the port
13 # should be 5000. Networking should be configured to allow the client
14 # machine to reach port 5000 on this server. If netcat is not installed
15 # as /bin/nc, change the spawn line below as appropriate.
19 # 1) Ensure the staff client is configured as per the prerequisites, and
20 # clear all tabs in the staff client.
21 # 2) Invoke this script.
22 # 3) In the staff client, press F4 or invoke Search -> Search for
23 # Patrons. Enter Smith for the last name and submit the search.
24 # Retrieve the first patron, Cathy Smith. If the RFID checkbox is
25 # unchecked, check it.
26 # 4) The client will attempt to circulate CONC4000049, which is already
27 # checked out to another user. Click "Cancel".
28 # 5) The client will attempt to circulate CONC4000048, which is already
29 # checked out to another user. Click "Normal Checkin then Checkout".
30 # 6) The client will circulate CONC70000408, but the fake GoodStuff will
31 # fail to deactivate the security flag for the item. Click
32 # "Deactivate Security".
33 # 7) The client will circulate CONC70000401, but the fake GoodStuff will
34 # fail to deactivate the security flag for the item. Click "Make No
36 # 8) The fake GoodStuff will report a problem with CONC70000394, that it
37 # expected two parts but could only detect one. Click "Re-Scan Item".
38 # This item should circulate.
39 # 9) The fake GoodStuff will report a problem with CONC70000387, that it
40 # expected two parts but could only detect one. Click "Proceed with
41 # Item". This item should circulate.
42 # 10) Close the tab or click Done (and cancel any print job). The script
43 # should end without errors.
45 # Note: added some gratuitous whitespace near the end with the socket
46 # messages; client should ignore whitespace
49 proc send {ignore arg} {
54 spawn "/bin/nc" -l -p 5000
58 expect -exact "START|OK\r
61 expect -exact "CONC4000049"
64 CONC4000049|ACTIVATE\r
67 expect -exact "CONC4000049"
72 expect -exact "CONC4000048"
75 CONC4000048|DEACTIVATE\r
78 expect -exact "CONC4000048"
82 send -- "CONC70000408"
83 expect -exact "CONC70000408"
86 CONC70000408|DEACTIVATE\r
88 send -- "CONC70000408"
89 expect -exact "CONC70000408"
92 CONC70000408|DEACTIVATE\r
94 send -- "CONC70000408"
95 expect -exact "CONC70000408"
99 send -- "CONC70000401"
100 expect -exact "CONC70000401"
102 expect -exact "|1/1\r
103 CONC70000401|DEACTIVATE\r
105 send -- "CONC70000401"
106 expect -exact "CONC70000401"
108 expect -exact "|NOK\r
111 send -- "CONC70000401"
112 expect -exact "CONC70000401"
116 send -- "CONC70000394"
117 expect -exact "CONC70000394"
119 expect -exact "|1/2\r
120 CONC70000394|REREAD\r
122 send -- "CONC70000394"
123 expect -exact "CONC70000394"
125 expect -exact "|2/2\r
126 CONC70000394|DEACTIVATE\r
128 send -- "CONC70000394"
129 expect -exact "CONC70000394"
133 send -- "CONC70000387 "
134 expect -exact "CONC70000387 "
136 expect -exact "| 1/ 2 \r
137 CONC70000387|DEACTIVATE\r
139 send -- "CONC70000387"
140 expect -exact "CONC70000387"