Bugzilla – Attachment 19476 Details for
Bug 9288
Add a script to test SIP from the command line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9288 - Add a script to test SIP from the command line - QA Followup
Bug-9288---Add-a-script-to-test-SIP-from-the-comma.patch (text/plain), 3.23 KB, created by
Kyle M Hall (khall)
on 2013-07-08 13:21:41 UTC
(
hide
)
Description:
Bug 9288 - Add a script to test SIP from the command line - QA Followup
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-07-08 13:21:41 UTC
Size:
3.23 KB
patch
obsolete
>From edbaf324c0b21167889905b29ec87ac910b3f55d Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 8 Jul 2013 09:21:25 -0400 >Subject: [PATCH] Bug 9288 - Add a script to test SIP from the command line - QA Followup > >--- > misc/sip_cli_emulator.pl | 23 +++++++++++++++++------ > 1 files changed, 17 insertions(+), 6 deletions(-) > >diff --git a/misc/sip_cli_emulator.pl b/misc/sip_cli_emulator.pl >index a379da2..708b1bb 100755 >--- a/misc/sip_cli_emulator.pl >+++ b/misc/sip_cli_emulator.pl >@@ -1,5 +1,8 @@ > #!/usr/bin/perl > >+use Modern::Perl; >+ >+use Socket qw(:crlf); > use IO::Socket::INET; > use Getopt::Long; > >@@ -15,6 +18,8 @@ my $location_code; > my $patron_identifier; > my $patron_password; > >+my $terminator; >+ > GetOptions( > "a|address|host|hostaddress=s" => \$host, # sip server ip > "p|port=s" => \$port, # sip server port >@@ -25,6 +30,8 @@ GetOptions( > "patron=s" => \$patron_identifier, # patron cardnumber or login > "password=s" => \$patron_password, # patron's password > >+ "t|terminator=s" => \$terminator, >+ > 'h|help|?' => \$help > ); > >@@ -40,6 +47,8 @@ if ( $help > exit(); > } > >+$terminator = ( $terminator eq 'CR' ) ? $CR : $CRLF; >+ > my ( $sec, $min, $hour, $day, $month, $year ) = localtime(time); > $year += 1900; > my $transaction_date = "$year$month$day $hour$min$sec"; >@@ -47,15 +56,15 @@ my $transaction_date = "$year$month$day $hour$min$sec"; > my $institution_id = $location_code; > my $terminal_password = $login_password; > >-$socket = IO::Socket::INET->new("$host:$port") >+my $socket = IO::Socket::INET->new("$host:$port") > or die "ERROR in Socket Creation host=$host port=$port : $!\n"; > > my $login_command = "9300CN$login_user_id|CO$login_password|CP$location_code|"; > > print "\nOUTBOUND: $login_command\n"; >-print $socket $login_command . "\r"; >+print $socket $login_command . $terminator; > >-$data = <$socket>; >+my $data = <$socket>; > > print "\nINBOUND: $data\n"; > >@@ -71,7 +80,7 @@ if ( $data =~ '^941' ) { ## we are logged in > . "|AD" . $patron_password; > > print "\nOUTBOUND: $patron_status_request\n"; >- print $socket $patron_status_request . "\r"; >+ print $socket $patron_status_request . $terminator; > > $data = <$socket>; > >@@ -80,7 +89,7 @@ if ( $data =~ '^941' ) { ## we are logged in > ## Patron Information > print "\nTrying 'Patron Information'\n"; > my $summary = " "; >- my $patron_status_request = "63001" >+ $patron_status_request = "63001" > . $transaction_date > . $summary > . "AO" . $institution_id >@@ -89,7 +98,7 @@ if ( $data =~ '^941' ) { ## we are logged in > . "|AD" . $patron_password; > > print "\nOUTBOUND: $patron_status_request\n"; >- print $socket $patron_status_request . "\r"; >+ print $socket $patron_status_request . $terminator; > > $data = <$socket>; > >@@ -122,6 +131,8 @@ sip_cli_emulator.pl - SIP command line emulator > --patron ILS patron cardnumber or username > --password ILS patron password > >+ -t --terminator Specifies the SIP2 message terminator, either CR, or CRLF ( defaults to CRLF ) >+ > sip_cli_emulator.pl will make requests for information about the given user from the given server via SIP2. > > / >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9288
:
14146
|
14147
|
14148
|
14149
|
14150
|
14635
|
14640
|
18203
|
18268
|
19106
|
19476
|
21278
|
22286
|
22443
|
22444
|
22445
|
22446
|
23873