Bug 12225 added support for no block SIP messages for checkouts - we also need this option in the SIP cli emulator for testing purposes - this should be considered a bug eligible for backport to 22.05 at least
Created attachment 144855 [details] [review] Bug 32537: Add no-block option to SIP cli emulator This patch adds the option to pass a no-block option and use this in checkout/checkin/renew messages To test: 1 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 2 - Confirm out like: SEND: 09N20221227 20183920221227 201839APCPL|AOCPL|AB39999000010831|ACterm1|BIN| (Note the N after 09) 3 - Apply patch 4 - Restart SIP, repeat 1 5 - Confirm still an N 6 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n N 7 - Confirm still an N 8 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n Y 9 - Confirm the send has a Y after 09
Created attachment 144895 [details] [review] Bug 32537: Add no-block option to SIP cli emulator This patch adds the option to pass a no-block option and use this in checkout/checkin/renew messages To test: 1 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 2 - Confirm out like: SEND: 09N20221227 20183920221227 201839APCPL|AOCPL|AB39999000010831|ACterm1|BIN| (Note the N after 09) 3 - Apply patch 4 - Restart SIP, repeat 1 5 - Confirm still an N 6 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n N 7 - Confirm still an N 8 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n Y 9 - Confirm the send has a Y after 09 Signed-off-by: David Nind <david@davidnind.com>
Koha testing notes (using KTD - used 39999000011418 as the item). I have included the responses I got for the commands as there were unitialized values reported in the output, and I don't know whether these are expected or not. 1. Response for step 1: root@kohadevbox:koha(bz32537)$ perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000011418 Attempting socket connection to localhost:6001...connected! Use of uninitialized value $hold_mode in string eq at misc/sip_cli_emulator.pl line 120. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20230101 20473320230101 204733APCPL|AOCPL|AB39999000011418|ACterm1|BIN| READ: 101YNN20230101 204734AOCPL|AB39999000011418|AQCPL|AJProgramming Perl /|CRREF| 2. To restart SIP: koha-sip --restart kohadev 3. Response for step 4: root@kohadevbox:koha(bz32537)$ perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000011418 Attempting socket connection to localhost:6001...connected! Use of uninitialized value $hold_mode in string eq at misc/sip_cli_emulator.pl line 124. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20230101 20543120230101 205431APCPL|AOCPL|AB39999000011418|ACterm1|BIN| READ: 101YNN20230101 205431AOCPL|AB39999000011418|AQCPL|AJProgramming Perl /|CRREF| 4. Response for step 6: root@kohadevbox:koha(bz32537)$ perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000011418 -n N Attempting socket connection to localhost:6001...connected! Use of uninitialized value $hold_mode in string eq at misc/sip_cli_emulator.pl line 124. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20230101 20552620230101 205526APCPL|AOCPL|AB39999000011418|ACterm1|BIN| READ: 101YNN20230101 205526AOCPL|AB39999000011418|AQCPL|AJProgramming Perl /|CRREF| 5. Response for step 8: root@kohadevbox:koha(bz32537)$ perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000011418 -n Y Attempting socket connection to localhost:6001...connected! Use of uninitialized value $hold_mode in string eq at misc/sip_cli_emulator.pl line 124. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'checkin' SEND: 09Y20230101 20561720230101 205617APCPL|AOCPL|AB39999000011418|ACterm1|BIN| Use of uninitialized value $data in concatenation (.) or string at misc/sip_cli_emulator.pl line 356, <GEN0> chunk 1. READ:
Created attachment 144935 [details] [review] Bug 32537: (QA follow-up) Don't allow invalid no block values
Created attachment 144936 [details] [review] Bug 32537: (QA follow-up): Tidy code
Created attachment 145945 [details] [review] Bug 32537: Add no-block option to SIP cli emulator This patch adds the option to pass a no-block option and use this in checkout/checkin/renew messages To test: 1 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 2 - Confirm out like: SEND: 09N20221227 20183920221227 201839APCPL|AOCPL|AB39999000010831|ACterm1|BIN| (Note the N after 09) 3 - Apply patch 4 - Restart SIP, repeat 1 5 - Confirm still an N 6 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n N 7 - Confirm still an N 8 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n Y 9 - Confirm the send has a Y after 09 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 145946 [details] [review] Bug 32537: (QA follow-up) Don't allow invalid no block values Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 145947 [details] [review] Bug 32537: (QA follow-up): Tidy code Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Great addition for SIP testing.. Passing QA
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Backported to 22.05.x for upcoming 22.05.10
depends on 12225 which I failed to backport to 21.11.x. Can't backport this one either then.