From ad72cfcbba4aa139581a43a413f62789c5437958 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 21 Nov 2014 18:12:34 -0500 Subject: [PATCH] LP#1384740 marc_stream_importer test script Simple test script which sends a single authority record over the network for testing marc_stream_importer.pl. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../test-scripts/stream_importer_test.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 Open-ILS/src/support-scripts/test-scripts/stream_importer_test.pl diff --git a/Open-ILS/src/support-scripts/test-scripts/stream_importer_test.pl b/Open-ILS/src/support-scripts/test-scripts/stream_importer_test.pl new file mode 100755 index 0000000000..4d0d90b673 --- /dev/null +++ b/Open-ILS/src/support-scripts/test-scripts/stream_importer_test.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl +use strict; +use warnings; +use IO::Socket::INET; + +# simple test to send an authority record to marc_stream_importer.pl + +my $marc = '00208nz a2200097o 45 0001001400000003000500014005001700019008004100036040001500077100001800092IISGa11554924IISG20021207110052.0021207n| acannaabn |n aac d aIISGcIISG0 aMaloy, Eileen'; + +my $socket = IO::Socket::INET->new( + PeerAddr => 'localhost', + PeerPort => 5544, + Proto => 'tcp' +) or die "socket failure $!\n"; + +$socket->print($marc) or die "socket print failure: $!\n"; + +while (chomp(my $line = $socket->getline)) { + print "Read: $line\n"; +} + -- 2.11.0