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. The staff
16 # client should registered to the BR1 branch and the stock admin user
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 F2 or invoke Circulation -> Check In Items.
25 # If the RFID checkbox is unchecked, check it.
26 # 4) The client will transit item CONC90000480. Click "Do Not Print".
27 # 5) The client will fail to check in item "madeupitem". Click "OK".
28 # 6) The fake GoodStuff will report a problem scanning all the parts for
29 # item CONC40000120, and say that it read only 1 of 2 parts. Click
30 # "Re-Scan Item". The item will be checked in.
31 # 7) The client will check-in item CONC40000121, but the fake GoodStuff
32 # will report a problem setting the item's security flag. Click
33 # "Activate Security". The problem will persist. Click "Make No
35 # 8) Close the tab. The script should end without errors. This
36 # particular test may be ran again with identical results without
37 # needing to reset the test data.
40 proc send {ignore arg} {
45 spawn "/bin/nc" -l -p 5000
49 expect -exact "START|OK\r
51 send -- "CONC90000480"
52 expect -exact "CONC90000480"
55 CONC90000480|ACTIVATE\r
57 send -- "CONC90000480"
58 expect -exact "CONC90000480"
62 send -- "madeupitem|1/1\r"
63 expect -exact "madeupitem|1/1\r
66 send -- "madeupitem|OK\r"
67 expect -exact "madeupitem|OK\r
69 send -- "CONC40000120"
70 expect -exact "CONC40000120"
75 send -- "CONC40000120"
76 expect -exact "CONC40000120"
79 CONC40000120|ACTIVATE\r
81 send -- "CONC40000120"
82 expect -exact "CONC40000120"
86 send -- "CONC40000121"
87 expect -exact "CONC40000121"
90 CONC40000121|ACTIVATE\r
92 send -- "CONC40000121"
93 expect -exact "CONC40000121"
96 CONC40000121|ACTIVATE\r
98 send -- "CONC40000121"
99 expect -exact "CONC40000121"
101 expect -exact "|NOK\r
104 send -- "CONC40000121"
105 expect -exact "CONC40000121"