Bug 13159 - Enhancements to the SIP2 command line emulator
Summary: Enhancements to the SIP2 command line emulator
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-29 12:56 UTC by Kyle M Hall
Modified: 2015-12-03 22:11 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13159 - Enhancements to the SIP2 command line emulator (15.44 KB, patch)
2014-10-29 12:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (15.44 KB, patch)
2014-10-29 13:54 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (16.22 KB, patch)
2014-10-29 15:13 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (16.19 KB, patch)
2014-10-29 15:15 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (16.18 KB, patch)
2014-10-30 10:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (16.18 KB, patch)
2014-10-30 10:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (18.13 KB, patch)
2014-11-18 13:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (18.22 KB, patch)
2014-11-25 14:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (18.28 KB, patch)
2014-11-25 15:22 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (20.89 KB, patch)
2015-01-09 11:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (21.04 KB, patch)
2015-01-13 14:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (21.98 KB, patch)
2015-01-22 12:12 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (22.23 KB, patch)
2015-02-05 08:50 UTC, Benjamin Rokseth
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Fix flag parameters (4.25 KB, patch)
2015-02-24 14:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Fix changed namespace for Sip::Constants (701 bytes, patch)
2015-03-02 13:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Move script back to it's original path (564 bytes, patch)
2015-03-02 13:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13159 - Enhancements to the SIP2 command line emulator (22.29 KB, patch)
2015-03-03 16:24 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Fix flag parameters (4.31 KB, patch)
2015-03-03 16:24 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Fix changed namespace for Sip::Constants (761 bytes, patch)
2015-03-03 16:25 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Move script back to it's original path (624 bytes, patch)
2015-03-03 16:26 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Fix transaction_date and undefined warning (1.33 KB, patch)
2015-03-03 16:27 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Move script back to it's original path (1.22 KB, patch)
2015-03-03 16:47 UTC, Benjamin Rokseth
Details | Diff | Splinter Review
Bug 13159 [QA Followup] - Remove unused call to localtime() (823 bytes, patch)
2015-04-07 14:29 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2014-10-29 12:56:37 UTC
I needed to be able to perform checkout operations for testing from the command line. I ended up reengineering the SIP2 command line tester quite a bit.

Enhancements:
* Moved message generation code to subroutines
* Added checkout message support
* Added command line switches for each supported message
* Enabled use of Sip::Constants to keep code DRY and more understandable
* Moved script from misc to C4/SIP
* Designed with an eye towards possibly moving some code to CPAN in the future
Comment 1 Kyle M Hall 2014-10-29 12:59:14 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-10-29 13:54:11 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2014-10-29 15:13:01 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2014-10-29 15:15:51 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2014-10-30 10:51:06 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2014-10-30 10:52:34 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall 2014-11-18 13:02:28 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2014-11-25 14:41:33 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2014-11-25 15:22:01 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall 2015-01-09 11:44:33 UTC Comment hidden (obsolete)
Comment 11 Kyle M Hall 2015-01-13 14:42:05 UTC Comment hidden (obsolete)
Comment 12 Kyle M Hall 2015-01-22 12:12:40 UTC Comment hidden (obsolete)
Comment 13 Benjamin Rokseth 2015-02-05 08:50:01 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2015-02-11 10:47:15 UTC
This looks awesome!
I am just wondering why you have moved the script to C4/Sip.
Comment 15 Kyle M Hall 2015-02-24 14:42:21 UTC
(In reply to Jonathan Druart from comment #14)
> This looks awesome!
> I am just wondering why you have moved the script to C4/Sip.

Because it uses Sip::MsgType

Moving it there means no need to run it with perl -I at the command line.
Comment 16 Kyle M Hall 2015-02-24 14:59:46 UTC Comment hidden (obsolete)
Comment 17 Kyle M Hall 2015-03-02 13:33:05 UTC Comment hidden (obsolete)
Comment 18 Kyle M Hall 2015-03-02 13:33:55 UTC Comment hidden (obsolete)
Comment 19 Benjamin Rokseth 2015-03-03 08:54:13 UTC
Still works as intended, so leaving this bug as Signed off for QA
Comment 20 Olli-Antti Kivilahti 2015-03-03 12:06:28 UTC
Testing SIP2 messages, looking into 3M SIP2.0 manual. MEssages are not standards compliant:

63 && 23:
- Non-standard compliant, has no zero padded month, day and second. Distorts fixed-length fields.
- fields ok


24:
- OK


64:
- OK

No institution ID anywhere??
Will be fixed by 13666.

Silly warning:
Use of uninitialized value $value in concatenation (.) or string at ./sip_cli_emulator.pl line 462, <GEN0> chunk 1.
is ruining my day.


Otherwise works as expected.

Will proceed to fix and provide a followup.
Comment 21 Olli-Antti Kivilahti 2015-03-03 16:24:28 UTC
Created attachment 36419 [details] [review]
Bug 13159 - Enhancements to the SIP2 command line emulator

I needed to be able to perform checkout operations for testing from the
command line. I ended up reengineering the SIP2 command line tester
quite a bit.

Enhancements:
* Moved message generation code to subroutines
* Added support for more messages
* Added command line switches for each supported message
* Enabled use of Sip::Constants to keep code DRY and more understandable
* Moved script from misc to C4/SIP
* Designed with an eye towards possibly moving some code to CPAN in the future
* Also designed to make adding new messages much easier in the future

Test Plan:
1) Apply this patch
2) Look at help via ./C4/SIP/sip_cli_emulator.pl --help
3) Test patron status request and patron information, should work as before
   except you need to pass the command line switche -m <message_name>
4) Test the new checkout option using -m checkout -i <item barcode>

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Worked as advertised, with one warning at renew only:

Trying 'renew'
Use of uninitialized value $value in concatenation (.) or string at ./sip_cli_emulator.pl line 462, <GEN0> chunk 1.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Comment 22 Olli-Antti Kivilahti 2015-03-03 16:24:56 UTC
Created attachment 36420 [details] [review]
Bug 13159 [QA Followup] - Fix flag parameters

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Comment 23 Olli-Antti Kivilahti 2015-03-03 16:25:41 UTC
Created attachment 36421 [details] [review]
Bug 13159 [QA Followup] - Fix changed namespace for Sip::Constants

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Comment 24 Olli-Antti Kivilahti 2015-03-03 16:26:36 UTC
Created attachment 36422 [details] [review]
Bug 13159 [QA Followup] - Move script back to it's original path

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Comment 25 Olli-Antti Kivilahti 2015-03-03 16:27:07 UTC
Created attachment 36423 [details] [review]
Bug 13159 [QA Followup] - Fix transaction_date and undefined warning

cli-client doesnt respect the transaction_date format
  "YYYYMMDDZZZZHHMMSS"
Using timestamp() to generate the proper datetime format.

"String $value undefined"-warning in build_field() fixed.
Comment 26 Benjamin Rokseth 2015-03-03 16:47:21 UTC Comment hidden (obsolete)
Comment 27 Benjamin Rokseth 2015-03-03 16:50:14 UTC
Comment on attachment 36426 [details] [review]
Bug 13159 [QA Followup] - Move script back to it's original path

patched the wrong bug, silly me!
Comment 28 Kyle M Hall 2015-04-07 14:29:40 UTC
Created attachment 37547 [details] [review]
Bug 13159 [QA Followup] - Remove unused call to localtime()
Comment 29 Colin Campbell 2015-04-17 11:51:41 UTC
NB this is fairly self contained to the emulator should have no effects on other parts of the system - applies cleanly. RM may want to squash these into one patch
Comment 30 Tomás Cohen Arazi 2015-04-22 16:29:20 UTC
Patches pushed to master.

Thanks Kyle!