https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43854 Bug ID: 43854 Summary: Support the other SIP messages in the SIP2 message tester Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Depends on: 43848 Target Milestone: --- Bug 42769 added a tool to the staff interface that runs a SIP2 message through the real SIP handlers and shows the response the account would generate. It supports five messages: patron status, patron information, item information, checkout and checkin. Bug 43848 moves the request parsing, the request building and the session setup out into shared code, used by the SIP server, the SIP command line emulator and the tester. This bug adds the other messages a terminal sends, so that the tester can be used to check a whole SIP flow and not only the first few messages of one: - Hold (15) - Renew (29) - Renew all (65) - Fee paid (37) - Block patron (01) - Patron enable (25) - End patron session (35) - Item status update (19) - SC status (99), whose response (ACS status) describes what the account allows Login (93) and request ACS resend (97) are left out, the tester does not authenticate and has no session to resend. What each message needs: - The request builders. The emulator already has hold, renew and fee paid. The rest are added to Koha::SIP2::RequestBuilder, and the emulator can use them too. - A form with the fields the SIP2 specification gives that message, as the first five have, and the same raw request box. - Response breakdown. The tester splits a response into its fixed part and its fields using the length of the fixed part of each response, which has to be known for each new response. - The same checks as the first five. Any patron or item that a request names has to be one the user may see (library restrictions, IndependentBranches), including the new places they can appear, such as the title of a hold. A patron password is never checked, GOOD or BAD says what it should be, for every message that carries one. - The same isolation. Like a checkout, these change data, which is rolled back, and the things a rollback does not undo are kept out the same way. Hold, renew and fee paid also queue notices and run plugin hooks, which needs a look. Something to decide here, because the point is to test a flow: every message runs in its own transaction that is rolled back, so a hold cannot be followed by a checkin that sees it. An option to run several messages in one transaction, rolled back at the end, would make a flow testable. It could be this bug or a bug of its own. Test plan: 1. Apply the patches of bug 42769, of bug 43848 and then of this bug 2. Open a SIP2 account in the staff interface and use "Test SIP2 messages" 3. For each new message type, fill in the form and run it, and check that the response is the one the SIP server gives for the same request (compare with misc/sip_cli_emulator.pl against a SIP server if you like) 4. Check that a patron or an item you may not see is refused for each message, and that a real patron password is refused 5. Run prove t/db_dependent/Koha/SIP2/ t/db_dependent/api/v1/sip2_account_test_message.t 6. Sign off :-D Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43848 [Bug 43848] Share SIP request parsing and building between server, emulator and tester -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.