Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c	(revision 34935)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c	(revision 34936)
@@ -1,4 +1,4 @@
 # include "dvopsps.h"
-# define DEBUG 0
+# define DEBUG 1
 # define SQL_INSERT 1
 // 1 = write data via sql insert values = (), 
@@ -128,4 +128,5 @@
   if (mysql) {
 # if (SQL_INSERT)    
+    if (DEBUG) fprintf (stderr, "%s\n", buffer->buffer);
     int status = mysql_query(mysql, buffer->buffer); 
 # else
Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/src/mysql_dvopsps.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/src/mysql_dvopsps.c	(revision 34935)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/src/mysql_dvopsps.c	(revision 34936)
@@ -50,11 +50,11 @@
   dump_result (connection);
     
-  sprintf (query, "set max_allowed_packet = %d;", 2*MAX_BUFFER);
-  if (mysql_query (connection, query)) {
-    fprintf (stderr, "failed to set max_allowed_packet\n");
-    fprintf (stderr, "%s\n", mysql_error (connection));
-    return NULL;
-  }
-  dump_result (connection);
+  // sprintf (query, "set max_allowed_packet = %d;", 2*MAX_BUFFER);
+  // if (mysql_query (connection, query)) {
+  //   fprintf (stderr, "failed to set max_allowed_packet\n");
+  //   fprintf (stderr, "%s\n", mysql_error (connection));
+  //   return NULL;
+  // }
+  // dump_result (connection);
     
   sprintf (query, "show variables like 'max_allowed_packet';");
Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/dbadmin.sh
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/dbadmin.sh	(revision 34935)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/dbadmin.sh	(revision 34936)
@@ -18,10 +18,15 @@
 
 if ("$1" == "create") then
-  if ($#argv != 4) goto usage;
+  if ($#argv < 4) goto usage;
   set dbhost = $2
   set dbname = $3
   set dbuser = $4
+  if ($#argv == 5) then
+    set dbpass = "-p$5"
+  else 
+    set dbpass = "-p"
+  endif
 
-  mysql -h $dbhost -u $dbuser -p <<EOF
+  mysql -h $dbhost -u $dbuser $dbpass <<EOF
    CREATE DATABASE $dbname;
    USE $dbname;
@@ -48,10 +53,17 @@
 
 if ("$1" == "delete") then
-  if ($#argv != 4) goto usage;
+  if ($#argv < 4) goto usage;
   set dbhost = $2
   set dbname = $3
   set dbuser = $4
+  if ($#argv == 5) then
+    set dbpass = "-p$5"
+  else 
+    set dbpass = "-p"
+  endif
 
-  mysql -h $dbhost -u $dbuser -p <<EOF > /dev/null
+  echo mysql -h $dbhost -u $dbuser $dbpass
+
+  mysql -h $dbhost -u $dbuser $dbpass <<EOF > /dev/null
    USE $dbname;
    describe dvoDetection;
@@ -64,5 +76,5 @@
 
   echo "database is valid, deleting"
-  mysql -h $dbhost -u $dbuser -p <<EOF
+  mysql -h $dbhost -u $dbuser $dbpass <<EOF
    drop database $dbname;
 EOF
Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/mkcatdir.dvo
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/mkcatdir.dvo	(revision 34935)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/mkcatdir.dvo	(revision 34936)
@@ -38,20 +38,21 @@
     mkinput $offset:$i
     exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1
-    exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2
+    exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
   end
 
-  exec relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 >& /dev/null
+  break -auto off
+  echo dbadmin.sh delete localhost dvotest dvo dvo
+  exec dbadmin.sh delete localhost dvotest dvo dvo
+  break -auto on
 
-  catdir catdir.test
-  skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} 
+  echo dbadmin.sh create localhost dvotest dvo dvo
+  exec dbadmin.sh create localhost dvotest dvo dvo
 
-  imextract time Mcal
+  echo dvopsps -D CATDIR catdir.test -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -dbhost localhost -dbname dvotest -dbuser dvo -dbpass dvo
+  exec dvopsps -D CATDIR catdir.test -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -dbhost localhost -dbname dvotest -dbuser dvo -dbpass dvo
 
-  for i 0 $offset:n
-    tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i"
-  end
-
-  exec rm test.cmf test.in.txt
-  exec rm -r catdir.test
+  # for i 0 $offset:n
+  #   tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i"
+  # end
 
   tapDONE
Index: /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/tap.dvo
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/tap.dvo	(revision 34936)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/dvopsps/test/tap.dvo	(revision 34936)
@@ -0,0 +1,72 @@
+# -*-sh-*-
+
+if (not($?TAP_BREAK)) set TAP_BREAK = 0
+if (not($?TAP_VERBOSE)) set TAP_VERBOSE = 0
+
+macro tapOK
+  if ($0 != 3) 
+    echo "USAGE: tapOK (condition) (message)"
+    break
+  end
+
+  if ($1)
+    if ($TAP_VERBOSE)
+      echo "ok : $2"
+    end
+    $TAP_LAST = 1
+  else
+    echo "not ok : $2"
+    $TAP_NFAIL ++
+    $TAP_LAST = 0
+    if ($TAP_BREAK)
+     break
+    end
+  end
+  $TAP_NDONE ++
+end
+
+macro tapPLAN
+  if ($0 != 2) 
+    echo "USAGE: tapPLAN (Ntests)"
+    break
+  end
+
+  $TAP_NTEST = $1
+  $TAP_NFAIL = 0
+  $TAP_NSKIP = 0
+  $TAP_NDONE = 0
+  if (not($?TAP_BREAK)) set TAP_BREAK = 0
+end
+
+macro tapSKIP
+  if ($0 != 2) 
+    echo "USAGE: tapSKIP (nskip)"
+    break
+  end
+
+  $TAP_NSKIP += $1
+  $TAP_NDONE += $1
+end
+
+macro tapDONE
+  if ($0 != 1) 
+    echo "USAGE: tapDONE"
+    break
+  end
+
+  if ($TAP_NDONE != $TAP_NTEST) 
+    echo "planned tests ($TAP_NTEST) not equal to done tests ($TAP_NDONE)"
+  end
+
+  if ($TAP_NFAIL) 
+    echo "failed $TAP_NFAIL of $TAP_NDONE"
+  end
+
+  if ($TAP_NSKIP) 
+    echo "skipped $TAP_NSKIP of $TAP_NDONE"
+  end
+
+  if ($TAP_NFAIL + $TAP_NSKIP == 0) 
+    echo "passed $TAP_NDONE tests"
+  end
+end
