[open-ils-commits] r19409 - trunk/Open-ILS/src/support-scripts (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Feb 8 12:56:12 EST 2011


Author: miker
Date: 2011-02-08 12:56:08 -0500 (Tue, 08 Feb 2011)
New Revision: 19409

Modified:
   trunk/Open-ILS/src/support-scripts/settings-tester.pl
Log:
Patch from Robert Soulliere to update settings-tester.pl

Changes include:

- Use Test::More perl module to replace eval/die tests for initial tests (as indicated in FIXME comment)
Note/question: should I add an install of the Test::More perl module in Makefile.install for Evergreen prerequisites?

- Add a statement to print postgresql version.

- Add an elsif during "driver" testing to say OK to SIP driver since this is used in telephony section. -- remove scary ERROR

- Add UUID::Tiny to perl module list of checks.
question: More perl module checks needed?



Modified: trunk/Open-ILS/src/support-scripts/settings-tester.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/settings-tester.pl	2011-02-08 17:22:00 UTC (rev 19408)
+++ trunk/Open-ILS/src/support-scripts/settings-tester.pl	2011-02-08 17:56:08 UTC (rev 19409)
@@ -2,23 +2,14 @@
 # vim:noet:ts=4:
 use strict;
 use warnings;
+use Test::More tests => 5;
+use Error qw(:try);
 
-#FIXME: use Test::More or any kind of Test module instead of eval/die if
+use_ok( 'OpenSRF::Utils::Config' );
+use_ok( 'UNIVERSAL::require' );
+use_ok( 'Getopt::Long' );
+use_ok( 'Net::Domain' );
 
-BEGIN {
-	eval "use OpenSRF::Utils::Config;";
-	die "Please ensure that /openils/lib/perl5 is in your PERL5LIB environment variable.
-	You must run this script as the 'opensrf' user.\n" if ($@);
-	eval "use Error qw/:try/;";
-	die "Please install Error.pm.\n" if ($@);
-	eval "use UNIVERSAL::require;";
-	die "Please install the UNIVERSAL::require perl module.\n" if ($@);
-	eval "use Getopt::Long;";
-	die "Please install the Getopt::Long perl module.\n" if ($@);
-	eval "use Net::Domain;";
-	die "Please install the Net::Domain perl module.\n" if ($@);
-}
-
 my $output = '';
 my $perloutput = '';
 my $result;
@@ -139,6 +130,9 @@
 	$output .= test_db_connect($db_name, $db_host, $db_port, $db_user, $db_pw, $osrf_xpath);
 }
 
+print "\nChecking postgresql version\n";
+system ("psql", "--version");
+
 print "\nChecking database drivers to ensure <driver> matches <language>\n";
 # Check database drivers
 # if language eq 'C', driver eq 'pgsql'
@@ -180,6 +174,10 @@
 			$result = "* ERROR: $driver language is $language in $lang_xpath\n";
 			warn $result;
 		}
+
+	} elsif ($driver eq "SIP") {
+			$result = "* OK SIP from telephony section. \n";
+			warn $result;
 	} else {
 		$result = "* ERROR: Unknown driver $driver in $driver_xpath\n";
 		warn $result;
@@ -430,3 +428,6 @@
 Parse::RecDescent
 SRU
 JSON::XS
+UUID::Tiny
+Business::CreditCard::Object
+Net::Z3950::Simple2ZOOM



More information about the open-ils-commits mailing list