[LON-CAPA-cvs] cvs: doc /loncapafiles sanitycheck.piml

harris41 lon-capa-cvs@mail.lon-capa.org
Sun, 03 Mar 2002 04:29:10 -0000


harris41		Sat Mar  2 23:29:10 2002 EDT

  Added files:                 
    /doc/loncapafiles	sanitycheck.piml 
  Log:
  checking for possible bugs associated with loncapa.conf, access.conf,
  hosts.tab, and spare.tab
  
  

Index: doc/loncapafiles/sanitycheck.piml
+++ doc/loncapafiles/sanitycheck.piml
<!-- sanitycheck.piml -->
<!-- Scott Harrison -->

<!-- $Id: sanitycheck.piml,v 1.1 2002/03/03 04:29:10 harris41 Exp $ -->

<!--

This file is part of the LearningOnline Network with CAPA (LON-CAPA).

LON-CAPA is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

LON-CAPA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with LON-CAPA; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

/home/httpd/html/adm/gpl.txt

http://www.lon-capa.org/

-->

<piml>
<targetroot>/</targetroot>
<files>
<file>
<target dist='default'>/etc/httpd/conf/loncapa.conf</target>
<perlscript mode='fg'>
my $diff=`diff ../../loncom/loncapa.conf <TARGET />`;
if ($diff) {
  print "**** ERROR **** There are unexpected differences for <TARGET />\n";
}
</perlscript>
</file>
<file>
<target dist='default'>/etc/httpd/conf/access.conf</target>
<perlscript mode='fg'>
my $diff=`diff -y --suppress-common-lines ../access.conf <TARGET /> | grep -v PerlSetVar | grep -v 'Include conf/loncapa.conf'`;
if ($diff) {
  print "**** ERROR **** There are unexpected differences for <TARGET />\n";
}
open IN, "&lt;<TARGET />";
my $hbug=-1;
my $dbug=-1;
while (&lt;IN&gt;) {
 if (/PerlSetVar\s+lonHostID\s+(\S+)/) {
  my $v=$1;
  $hbug=0;
  $hbug=1 if $v=~/\W/;
  $hbug=1 if $v=~/\_/;
 }
 if (/PerlSetVar\s+lonDefDomain\s+(\S+)/) {
  my $v=$1;
  $dbug=0;
  $dbug=1 if $v=~/\W/;
  $dbug=1 if $v=~/\_/;
 }
}
if ($hbug) {
  print "**** ERROR **** <TARGET /> has invalid lonHostID\n";
}
if ($dbug) {
  print "**** ERROR **** <TARGET /> has invalid lonDefDomain\n";
}
</perlscript>
</file>
<file>
<target dist='default'>/home/httpd/lonTabs/hosts.tab</target>
open IN, "&lt;<TARGET />";
my $rbug=0;
my $dbug=0;
my $sbug=0;
my $fbug=0;
while (&lt;IN&gt;) {
 if (/\S/) {
  $rbug=1 if /\r/;
  my @a=split(/\:/,$_);
  $dbug=1 if $a[0]=~/\W/;
  $dbug=1 if $a[0]=~/\_/;
  $dbug=1 if $a[1]=~/\_/;
  $dbug=1 if $a[1]=~/\W/;
  $fbug=1 if @a!=5;
  $sbug=1 if /\s.+$/;
 }
}
close IN;
if ($rbug) {
  print "**** ERROR **** <TARGET /> is DOS-formatted\n";
}
if ($dbug) {
  print "**** ERROR **** <TARGET /> has invalid host id or domain id\n";
}
if ($fbug) {
  print "**** ERROR **** <TARGET /> is lacking 5 columns for every row\n";
}
if ($sbug) {
  print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
}
</file>
<file>
<target dist='default'>/home/httpd/lonTabs/spare.tab</target>
open IN, "&lt;<TARGET />";
my $rbug=0;
my $dbug=0;
my $sbug=0;
while (&lt;IN&gt;) {
 if (/\S/) {
  $rbug=1 if /\r/;
  $dbug=1 if $_=~/\W.*\n$/;
  $dbug=1 if $_=~/\_/;
  $sbug=1 if /\s.+$/;
 }
}
close IN;
if ($rbug) {
  print "**** ERROR **** <TARGET /> is DOS-formatted\n";
}
if ($dbug) {
  print "**** ERROR **** <TARGET /> has invalid host id\n";
}
if ($sbug) {
  print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
}
</file>
</files>
</piml>