Bug 32537 - Add 'no_block' option to sip_cli_emulator
Summary: Add 'no_block' option to sip_cli_emulator
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 12225
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-27 20:20 UTC by Nick Clemens
Modified: 2023-12-28 20:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhanced adds the no-block option to the SIP emulator for optional use in checkout/checkin/renew messages.
Version(s) released in:
23.05.00,22.11.03,22.05.10


Attachments
Bug 32537: Add no-block option to SIP cli emulator (3.29 KB, patch)
2022-12-27 20:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32537: Add no-block option to SIP cli emulator (3.34 KB, patch)
2023-01-01 20:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32537: (QA follow-up) Don't allow invalid no block values (826 bytes, patch)
2023-01-03 13:12 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32537: (QA follow-up): Tidy code (802 bytes, patch)
2023-01-03 13:15 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32537: Add no-block option to SIP cli emulator (3.41 KB, patch)
2023-02-01 13:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 32537: (QA follow-up) Don't allow invalid no block values (893 bytes, patch)
2023-02-01 13:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 32537: (QA follow-up): Tidy code (869 bytes, patch)
2023-02-01 13:54 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2022-12-27 20:20:31 UTC
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
Comment 1 Nick Clemens 2022-12-27 20:25:28 UTC Comment hidden (obsolete)
Comment 2 David Nind 2023-01-01 20:58:41 UTC
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>
Comment 3 David Nind 2023-01-01 21:13:38 UTC
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:
Comment 4 Kyle M Hall 2023-01-03 13:12:50 UTC
Created attachment 144935 [details] [review]
Bug 32537: (QA follow-up) Don't allow invalid no block values
Comment 5 Kyle M Hall 2023-01-03 13:15:05 UTC
Created attachment 144936 [details] [review]
Bug 32537: (QA follow-up): Tidy code
Comment 6 Martin Renvoize 2023-02-01 13:54:35 UTC
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>
Comment 7 Martin Renvoize 2023-02-01 13:54:39 UTC
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>
Comment 8 Martin Renvoize 2023-02-01 13:54:44 UTC
Created attachment 145947 [details] [review]
Bug 32537: (QA follow-up): Tidy code

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2023-02-01 13:55:06 UTC
Great addition for SIP testing.. Passing QA
Comment 10 Tomás Cohen Arazi 2023-02-03 13:32:46 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 11 Jacob O'Mara 2023-02-06 16:28:03 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 12 Lucas Gass 2023-02-14 22:03:59 UTC
Backported to 22.05.x for upcoming 22.05.10
Comment 13 Arthur Suzuki 2023-02-17 10:15:17 UTC
depends on 12225 which I failed to backport to 21.11.x.
Can't backport this one either then.