Index: branches/eam_branches/ipp-20121219/ippToPsps/config/ippToPspsDbSchema.sql
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/config/ippToPspsDbSchema.sql	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/config/ippToPspsDbSchema.sql	(revision 35063)
@@ -122,4 +122,5 @@
   `queue_OB` tinyint(1) default '0',
   `active` tinyint(1) default '1',
+  `parallel` tinyint(1) default '0',
   UNIQUE KEY `name` (`name`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Index: branches/eam_branches/ipp-20121219/ippToPsps/config/settings.xml
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/config/settings.xml	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/config/settings.xml	(revision 35063)
@@ -8,20 +8,14 @@
   <logPath>logs</logPath>
 
-  <!-- local scratch Db section -->
+  <!-- local scratch Db section (REAL version) -->
   <localdatabase>
-    <name>ipptopsps_test_scratch</name>
-    <host>localhost</host>
+    <name>ipptopsps_scratch</name>
+    <host>ipp005</host>
     <user>dvo</user>
     <password>dvo</password>
   </localdatabase>
 
-  <!-- GPC1 Db section -->
+  <!-- GPC1 Db section (REAL version) -->
   <gpc1database>
-    <!-- TEST VERSION
-    <name>gpc1test</name>
-    <host>localhost</host>
-    <user>dvo</user>
-    <password>dvo</password> -->
-    <!-- REAL VERSION -->
     <name>gpc1</name>
     <host>ippdb01</host>
@@ -30,11 +24,35 @@
   </gpc1database>
 
-  <!-- ippToPsps Db section -->
+  <!-- ippToPsps Db section (REAL version) -->
   <ipptopspsdatabase>
+    <name>ipptopsps</name>
+    <host>localhost</host>
+    <user>dvo</user>
+    <password>dvo</password>
+  </ipptopspsdatabase>
+
+  <!-- local scratch Db section (TEST VERSION) -->
+  <localdatabase_test>
+    <name>ipptopsps_test_scratch</name>
+    <host>localhost</host>
+    <user>dvo</user>
+    <password>dvo</password>
+  </localdatabase_test>
+
+  <!-- GPC1 Db section (TEST VERSION) -->
+  <gpc1database_test>
+    <name>gpc1test</name>
+    <host>localhost</host>
+    <user>dvo</user>
+    <password>dvo</password>
+  </gpc1database_test>
+
+  <!-- ippToPsps Db section (TEST VERSION)  -->
+  <ipptopspsdatabase_test>
     <name>ipptopsps_test</name>
     <host>localhost</host>
     <user>dvo</user>
     <password>dvo</password>
-  </ipptopspsdatabase>
+  </ipptopspsdatabase_test>
 
   <!-- Czar Db section -->
Index: branches/eam_branches/ipp-20121219/ippToPsps/doc/upgrade.txt
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/doc/upgrade.txt	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/doc/upgrade.txt	(revision 35063)
@@ -1,2 +1,18 @@
+
+2013.01.26
+
+I have modified the methods which create the StackDetectionCalib and
+DetectionCalib tables to change the sql from "INSERT / UPDATE" to
+"SELECT / LOAD" operations.  these need a target tmp directory
+different from /tmp.  the trick is that /tmp has permissions which
+prevent my (joe-user) from removing the temp files in the jython code,
+but mysql will not write over an existing file, nor will it write to
+other random directories.  the easy solution is to create a subdir in
+/tmp for the output files.
+
+This simple modification speeds up the processing of the smfs by a
+factor of nearly 2x!
+
+
 
 2013.01.24 : Status of the ippToPsps Upgrade
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py	(revision 35063)
@@ -927,8 +927,9 @@
     def importIppTables(self, filter=""):
 
-       if self.config.test: regex = "XY33.psf"
-       else : regex = ".*.psf"
+       ## if self.config.test: regex = "XY33.psf"
+       ## else : regex = ".*.psf"
+       regex = ".*.psf"
   
-       # XXX EAM NOTE : this is fragile : requires PS1_V_
+       # XXX EAM NOTE : this is fragile : requires PS1_V4
        columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ"
 
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py	(revision 35063)
@@ -33,5 +33,5 @@
 
     '''
-    def __init__(self, logger, config, scratchDbName="ipptopsps_test_scratch"):
+    def __init__(self, logger, config, scratchDbName=None):
 
         # set up logging
@@ -49,7 +49,7 @@
         self.useStilts = 0
 
-        # connect to the specified scratch database
+        # connect to the specified scratch database, if a name is given, otherwise use the first version
         try:
-            self.scratchDb = ScratchDb(self.logger, self.config, scratchDbName)
+            self.scratchDb = ScratchDb(self.logger, self.config, '1', scratchDbName)
         except: raise
 
@@ -617,4 +617,7 @@
         cmd += " " + str(decCenter+halfSize)
 
+        if self.config.parallel:
+            cmd += " -parallel"
+
         self.logger.infoPair("Running dvopsps", cmd)
         p = Popen(cmd, shell=True, stdout=PIPE)
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/dvoobjects.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/dvoobjects.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/dvoobjects.py	(revision 35063)
@@ -67,4 +67,7 @@
         cmd += " -cpt " + region
 
+        if self.config.parallel:
+            cmd += " -parallel"
+
         self.logger.infoPair("Running dvopsps", cmd)
         p = Popen(cmd, shell=True, stdout=PIPE)
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/gpc1db.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/gpc1db.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/gpc1db.py	(revision 35063)
@@ -21,5 +21,11 @@
     '''
     def __init__(self, logger, config):
-        super(Gpc1Db, self).__init__(logger, config, "gpc1database")
+        # define database type
+        if (config.test): 
+            dbType = "gpc1database_test"
+        else:
+            dbType = "gpc1database"
+
+        super(Gpc1Db, self).__init__(logger, config, dbType)
 
     '''
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopsps.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopsps.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopsps.py	(revision 35063)
@@ -22,4 +22,13 @@
     '''
     def __init__(self, argv, logToStdout=1, logToFile=0):
+
+        testmode = False
+        for arg in sys.argv:
+            if arg == "-test": 
+                testmode = True
+                sys.argv.remove(arg)
+            if arg == "-t": 
+                testmode = True
+                sys.argv.remove(arg)
 
         # are the arsg ok? all programs require a config name
@@ -51,4 +60,9 @@
         # set up config object
         self.config = Config(self.PROGNAME, CONFIGNAME, self.configDir)
+        self.config.test = testmode
+
+        if self.config.test: print "using test mode"
+        else: print "not using test mode"
+
         self.logger = self.config.getLogger(self.HOST, self.PID, logToStdout, logToFile)
 
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopspsdb.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopspsdb.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopspsdb.py	(revision 35063)
@@ -18,5 +18,9 @@
     '''
     def __init__(self, logger, config):
-        super(IppToPspsDb, self).__init__(logger, config, "ipptopspsdatabase")
+        if (config.test): 
+            dbType = "ipptopspsdatabase_test"
+        else:
+            dbType = "ipptopspsdatabase"
+        super(IppToPspsDb, self).__init__(logger, config, dbType)
 
         self.MAX_FAILS = 5
@@ -965,4 +969,5 @@
         ,queue_ST \
         ,queue_OB \
+        ,parallel \
         FROM config \
         WHERE name = '" + self.config.name + "'"
@@ -1006,6 +1011,11 @@
             if rs.getInt(20) == 1: self.config.batchTypes.append("ST")
             if rs.getInt(21) == 1: self.config.batchTypes.append("OB")
+
             self.config.force = True # TODO
-            self.config.test = False # TODO
+            self.config.parallel = False # TODO
+
+            if rs.getInt(22) == 1: self.config.parallel = True
+
+            if self.config.parallel: print "USING parallel"
             self.config.isLoaded = True
         except:
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/loader.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/loader.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/loader.py	(revision 35063)
@@ -34,18 +34,18 @@
         super(Loader, self).__init__(argv, 1, 1)
 
-        # create gpc1 database objects
+        if self.config.parallel:
+            print "PARALLEL dvo"
+        else: 
+            print "SERIAL dvo"
+
+        # connect to the gpc1 database
         self.gpc1Db = Gpc1Db(self.logger, self.config)
 
-        # XXX this is really bad: need to get these from config... (see this code:)
-        ## XX # open config and grab database parameters
-        ## XX if not dbName: self.dbName = config.getDbName(dbType)
-        ## XX else: self.dbName = dbName
-
         # connect to scratch database
-        scratchDbs = ['ipptopsps_test_scratch', 'ipptopsps_test_scratch2', 'ipptopsps_test_scratch3']
-        for dbName in scratchDbs:
-            self.scratchDb = ScratchDb(self.logger, self.config, dbName)
-            if self.scratchDb.anyOtherConnections():
-                self.logger.errorPair("This scratch Db is already in use", dbName)
+        scratchDbs = ['1', '2', '3']
+        for dbVersion in scratchDbs:
+            self.scratchDb = ScratchDb(self.logger, self.config, dbVersion)
+            if not self.config.test and self.scratchDb.anyOtherConnections():
+                self.logger.errorPair("This scratch Db is already in use", self.scratchDb.dbName)
                 self.scratchDb.disconnect()
                 continue
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/scratchdb.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/scratchdb.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/scratchdb.py	(revision 35063)
@@ -19,6 +19,17 @@
     Constructor
     '''
-    def __init__(self, logger, config, dbName=None):
-        super(ScratchDb, self).__init__(logger, config, "localdatabase", dbName)
+    def __init__(self, logger, config, dbVersion, dbName=None):
+
+        # create gpc1 database objects
+        if (config.test): 
+            dbType = "localdatabase_test"
+        else:
+            dbType = "localdatabase"
+
+        if not dbName:
+            dbName = config.getDbName(dbType)
+            dbName += dbVersion
+
+        super(ScratchDb, self).__init__(logger, config, dbType, dbName)
 
         self.dvoDoneTable = "dvoDone"
Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/setupScratchDb.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/setupScratchDb.py	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/setupScratchDb.py	(revision 35063)
@@ -26,5 +26,5 @@
 
         try:
-            self.scratchDb = ScratchDb(self.logger, self.config, argv[2])
+            self.scratchDb = ScratchDb(self.logger, self.config, '0', argv[2])
         except:
             self.exitProgram("Could not connect to a scratch Db")
Index: branches/eam_branches/ipp-20121219/ippToPsps/test/fulltest.sh
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/test/fulltest.sh	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/test/fulltest.sh	(revision 35063)
@@ -25,13 +25,13 @@
 # mkgpc1.sh user localhost eam eam
 
-set mkgpc1      = 0
-set initdb      = 0
-set mkdummy     = 0
-set initscratch = 0
-set initbatch   = 0
-set camqueue    = 0
-set cambatch    = 0
-set stackqueue  = 0
-set stackbatch  = 0
+set mkgpc1       = 1
+set initdb       = 1
+set mkdummy      = 1
+set initscratch  = 1
+set initbatch    = 1
+set camqueue     = 1
+set cambatch     = 1
+set stackqueue   = 1
+set stackbatch   = 1
 set objectqueue  = 1
 set objectbatch  = 1
@@ -56,5 +56,5 @@
 # create a dummy config so setupScratchDb.py does not fail
 if ($mkdummy) then
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 dummy
 none
@@ -80,4 +80,5 @@
 0
 1
+0
 EOF
 endif
@@ -87,20 +88,20 @@
 
   # create the database (ignore failure if it already exists)
-  mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_test_scratch"
+  mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_test_scratch1"
   # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch2"
   # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch3"
 
-  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test_scratch"
+  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test_scratch1"
   # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch2"
   # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch3"
 
-  ippjython setupScratchDb.py dummy ipptopsps_test_scratch
-  # ippjython setupScratchDb.py dummy ipptopsps_scratch2
-  # ippjython setupScratchDb.py dummy ipptopsps_scratch3
+  ippjython setupScratchDb.py -test dummy ipptopsps_test_scratch1
+  # ippjython setupScratchDb.py -test dummy ipptopsps_scratch2
+  # ippjython setupScratchDb.py -test dummy ipptopsps_scratch3
 endif
 
 # this code is sensitive to a previously existing database?
 if ($camqueue) then
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 $queuename
 test_ds
@@ -126,4 +127,5 @@
 0
 1
+0
 y
 y
@@ -133,10 +135,10 @@
 if ($initbatch) then
   rm -rf $OUTDIR/IN
-  ippjython loader.py $queuename init
+  ippjython loader.py -test $queuename init
 endif
 
 if ($cambatch) then
   rm -rf $OUTDIR/P2
-  ippjython loader.py $queuename once
+  ippjython loader.py -test $queuename once
 endif
 
@@ -146,5 +148,5 @@
     set stackqueuename = $queuename\_stk
   endif
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 $stackqueuename
 test_ds
@@ -170,4 +172,5 @@
 0
 1
+0
 y
 y
@@ -180,5 +183,5 @@
   endif
   rm -rf $OUTDIR/ST
-  ippjython loader.py $stackqueuename once
+  ippjython loader.py -test $stackqueuename once
 endif
 
@@ -188,5 +191,5 @@
     set objectqueuename = $queuename\_obj
   endif
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 $objectqueuename
 test_ds
@@ -212,4 +215,5 @@
 1
 1
+0
 y
 y
@@ -222,5 +226,5 @@
   endif
   rm -rf $OUTDIR/OB
-  ippjython loader.py $objectqueuename once
-endif
-
+   ippjython loader.py -test $objectqueuename once
+endif
+
Index: branches/eam_branches/ipp-20121219/ippToPsps/test/mkgpc1data.dvo
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/test/mkgpc1data.dvo	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/test/mkgpc1data.dvo	(revision 35063)
@@ -4,4 +4,5 @@
 
 if (not($?VERBOSE)) set VERBOSE = 0
+if (not($?PARALLEL)) set PARALLEL = 0
 
 ## this script must be run in this directory, output data goes to 'testdata'
@@ -199,4 +200,16 @@
   end
 
+  if ($PARALLEL)
+    $hostname = `hostname`
+    exec rm -f $catdir/HostTable.dat
+    output $catdir/HostTable.dat
+    echo "# ID Hostname Catdir"
+    echo " 1 $hostname $catdir.p1"
+    echo " 2 $hostname $catdir.p2"
+    echo " 3 $hostname $catdir.p3"
+    output stdout
+    exec dvodist -out $catdir
+  end
+
   # for i 0 $offset:n
   #   tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i"
@@ -239,4 +252,16 @@
 
     exec addstar -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass
+  end
+
+  if ($PARALLEL)
+    $hostname = `hostname`
+    exec rm -f $catdir/HostTable.dat
+    output $catdir/HostTable.dat
+    echo "# ID Hostname Catdir"
+    echo " 1 $hostname $catdir.p1"
+    echo " 2 $hostname $catdir.p2"
+    echo " 3 $hostname $catdir.p3"
+    output stdout
+    exec dvodist -out $catdir
   end
 
@@ -358,4 +383,9 @@
 
 if ($SCRIPT)
+  if ($argv:n > 0)
+    if ("$argv:0" == "-parallel")
+      $PARALLEL = 1
+    end
+  end
   mkfull
   exit 0
Index: branches/eam_branches/ipp-20121219/ippToPsps/test/partest.sh
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/test/partest.sh	(revision 35063)
+++ branches/eam_branches/ipp-20121219/ippToPsps/test/partest.sh	(revision 35063)
@@ -0,0 +1,230 @@
+#!/bin/csh -f
+
+set stackqueuename = 0
+if ($#argv > 0) then
+  set stackqueuename = $1
+  echo "stackqueue: $stackqueuename"
+endif
+
+set objectqueuename = 0
+if ($#argv > 0) then
+  set stackqueuename = $1
+  echo "stackqueue: $stackqueuename"
+endif
+
+# a bit crude : get the datadir path by interpollation of the PATH element for psconfig
+foreach f ( `echo $PATH | tr : ' '` )
+  echo $f | grep $PSCONFDIR > /dev/null
+  if ($status) continue
+  set datadir = `echo $f | sed s/bin\$/share/`
+  break
+end
+setenv IPPTOPSPS_DATA $datadir/ipptopsps
+
+# before running this test, you must have a mysql user:
+# mkgpc1.sh user localhost eam eam
+
+set mkgpc1       = 0
+set initdb       = 0
+set mkdummy      = 0
+set initscratch  = 0
+set initbatch    = 0
+set camqueue     = 0
+set cambatch     = 0
+set stackqueue   = 1
+set stackbatch   = 1
+set objectqueue  = 1
+set objectbatch  = 1
+
+set OUTDIR = "testdata"
+set queuename = "test"
+
+if ($mkgpc1) then
+  mkgpc1data.dvo -parallel
+endif
+
+# create the ipptopsps database
+if ($initdb) then 
+
+  # does the database already exist?
+  # XXX this command will blow away an existing database!!
+  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test"
+  mysql -h localhost -u dvo -pdvo ipptopsps_test < $IPPTOPSPS_DATA/ippToPspsDbSchema.sql
+
+endif
+
+# create a dummy config so setupScratchDb.py does not fail
+if ($mkdummy) then
+  ippjython queue.py -test edit <<EOF
+dummy
+none
+IPP_PSPS
+0
+none
+none
+0
+0
+0
+0
+1
+none
+0
+0
+1
+1
+2001-01-01 00:00:00.0
+NONE
+NONE
+1
+0
+0
+1
+0
+EOF
+endif
+
+# re-create the ipptopsps database
+if ($initscratch) then 
+
+  # create the database (ignore failure if it already exists)
+  mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_test_scratch1"
+  # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch2"
+  # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch3"
+
+  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test_scratch1"
+  # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch2"
+  # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch3"
+
+  ippjython setupScratchDb.py -test dummy ipptopsps_test_scratch1
+  # ippjython setupScratchDb.py -test dummy ipptopsps_scratch2
+  # ippjython setupScratchDb.py -test dummy ipptopsps_scratch3
+endif
+
+# this code is sensitive to a previously existing database?
+if ($camqueue) then
+  ippjython queue.py -test edit <<EOF
+$queuename
+test_ds
+IPP_PSPS
+0
+catdir.cam
+$OUTDIR/catdir.cam
+9
+11
+19
+21
+2
+$OUTDIR
+0
+0
+1
+1
+2012-12-10 00:00:00.0
+3PI
+3PI
+1
+0
+0
+1
+1
+y
+y
+EOF
+endif
+
+if ($initbatch) then
+  rm -rf $OUTDIR/IN
+  ippjython loader.py -test $queuename init
+endif
+
+if ($cambatch) then
+  rm -rf $OUTDIR/P2
+  ippjython loader.py -test $queuename once
+endif
+
+# this code is sensitive to a previously existing database?
+if ($stackqueue) then
+  if ($stackqueuename == 0) then
+    set stackqueuename = $queuename\_stk
+  endif
+  ippjython queue.py -test edit <<EOF
+$stackqueuename
+test_ds
+IPP_PSPS
+0
+catdir.stk
+$OUTDIR/catdir.stk
+9
+11
+19
+21
+2
+$OUTDIR
+0
+0
+1
+1
+2012-12-10 00:00:00.0
+3PI
+3PI
+0
+1
+0
+1
+1
+y
+y
+EOF
+endif
+
+if ($stackbatch) then
+  if ($stackqueuename == 0) then
+    set stackqueuename = $queuename\_stk
+  endif
+  rm -rf $OUTDIR/ST
+  ippjython loader.py -test $stackqueuename once
+endif
+
+# this code is sensitive to a previously existing database?
+if ($objectqueue) then
+  if ($objectqueuename == 0) then
+    set objectqueuename = $queuename\_obj
+  endif
+  ippjython queue.py -test edit <<EOF
+$objectqueuename
+test_ds
+IPP_PSPS
+0
+catdir.stk
+$OUTDIR/catdir.stk
+9
+11
+19
+21
+2
+$OUTDIR
+0
+0
+1
+1
+2012-12-10 00:00:00.0
+3PI
+3PI
+0
+0
+1
+1
+0
+y
+y
+EOF
+endif
+
+if ($objectbatch) then
+  if ($objectqueuename == 0) then
+    set objectqueuename = $queuename\_obj
+  endif
+  rm -rf $OUTDIR/OB
+   ippjython loader.py -test $objectqueuename once
+endif
+
Index: branches/eam_branches/ipp-20121219/ippToPsps/test/sastest.sh
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/test/sastest.sh	(revision 35062)
+++ branches/eam_branches/ipp-20121219/ippToPsps/test/sastest.sh	(revision 35063)
@@ -19,11 +19,11 @@
 # mkgpc1.sh user localhost eam eam
 
-set mkgpc1      = 1
-set initdb      = 1
-set mkdummy     = 1
-set initscratch = 1
-set initbatch   = 0
-set camqueue    = 0
-set cambatch    = 0
+set mkgpc1      = 0
+set initdb      = 0
+set mkdummy     = 0
+set initscratch = 0
+set initbatch   = 1
+set camqueue    = 1
+set cambatch    = 1
 set stackqueue  = 1
 set stackbatch  = 1
@@ -41,6 +41,6 @@
   # does the database already exist?
   # XXX this command will blow away an existing database!!
-  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps"
-  mysql -h localhost -u dvo -pdvo ipptopsps < $IPPTOPSPS_DATA/ippToPspsDbSchema.sql
+  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test"
+  mysql -h localhost -u dvo -pdvo ipptopsps_test < $IPPTOPSPS_DATA/ippToPspsDbSchema.sql
 
 endif
@@ -48,5 +48,5 @@
 # create a dummy config so setupScratchDb.py does not fail
 if ($mkdummy) then
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 dummy
 none
@@ -72,4 +72,6 @@
 0
 1
+0
+1
 EOF
 endif
@@ -79,20 +81,20 @@
 
   # create the database (ignore failure if it already exists)
-  mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch"
+  mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch1"
   # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch2"
   # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch3"
 
-  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch"
+  mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch1"
   # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch2"
   # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch3"
 
-  ippjython setupScratchDb.py dummy ipptopsps_scratch
-  # ippjython setupScratchDb.py dummy ipptopsps_scratch2
-  # ippjython setupScratchDb.py dummy ipptopsps_scratch3
+  ippjython setupScratchDb.py -test dummy ipptopsps_scratch1
+  # ippjython setupScratchDb.py -test dummy ipptopsps_scratch2
+  # ippjython setupScratchDb.py -test dummy ipptopsps_scratch3
 endif
 
 # this code is sensitive to a previously existing database?
 if ($camqueue) then
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 $queuename
 test_ds
@@ -118,4 +120,6 @@
 0
 1
+0
+1
 y
 y
@@ -124,9 +128,9 @@
 
 if ($initbatch) then
-  ippjython loader.py $queuename init
+  ippjython loader.py -test $queuename init
 endif
 
 if ($cambatch) then
-  ippjython loader.py $queuename once
+  ippjython loader.py -test $queuename once
 endif
 
@@ -136,5 +140,5 @@
     set stackqueuename = $queuename\_stk
   endif
-  ippjython queue.py edit <<EOF
+  ippjython queue.py -test edit <<EOF
 $stackqueuename
 test_ds
@@ -160,4 +164,6 @@
 0
 1
+0
+1
 y
 y
@@ -169,5 +175,5 @@
     set stackqueuename = $queuename\_stk
   endif
-  ippjython loader.py $stackqueuename once
+  ippjython loader.py -test $stackqueuename once
 endif
 
