LP#1384740 marc_stream_importer test script
authorBill Erickson <berickxx@gmail.com>
Fri, 21 Nov 2014 23:12:34 +0000 (18:12 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 4 Nov 2015 20:32:41 +0000 (20:32 +0000)
Simple test script which sends a single authority record over the
network for testing marc_stream_importer.pl.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/support-scripts/test-scripts/stream_importer_test.pl [new file with mode: 0755]

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 (executable)
index 0000000..4d0d90b
--- /dev/null
@@ -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 0001001400000003000500014005001700019008004100036040001500077100001800092\1eIISGa11554924\1eIISG\1e20021207110052.0\1e021207n| acannaabn          |n aac     d\1e  \1faIISG\1fcIISG\1e\1faMaloy, Eileen\1e\1d';
+
+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";
+}
+