[svn-commits] r16 - main

thich01 at ingres.com thich01 at ingres.com
Mon Apr 14 14:03:45 PDT 2008


Author: thich01
Date: 2008-04-14 14:03:45 -0700 (Mon, 14 Apr 2008)
New Revision: 16

Modified:
   main/testit
Log:
97

Modified: main/testit
===================================================================
--- main/testit	2008-04-09 11:11:13 UTC (rev 15)
+++ main/testit	2008-04-14 21:03:45 UTC (rev 16)
@@ -14,6 +14,16 @@
 ##      20-Nov-2006 (hanal04)
 ##          Added int_rpl.
 
+if [ -f set_env.sh ]
+then
+  . ./set_env.sh
+else
+  echo "Error, I cannot find the set_env.sh script"
+  echo "This is required to use testit"
+  echo "Please run testit from the root directory of the Ingres source"
+  exit 1
+fi
+
 # Change source root here if it differs from ${srcroot}
 srcroot=/devsrc
 REBUILD=true
@@ -29,8 +39,8 @@
 # probably should be generic.
 #ING_LIB=`dirname $ING_ROOT`
 #lib=`basename $ING_LIB`
-ING_LIB=`$ING_ROOT`
-lib=main
+ING_LIB=$ING_ROOT
+productname=ingres2006
 
 pjobs=1
 testlabel=
@@ -56,15 +66,18 @@
 	;;
 esac
 
-# Chuck - added this so it would override the rpm install on linux.  Until the
-# rpms are built properly.
-RPMARCH=
+#function usage()
+#{
+#    echo "Usage: testit [-testonly|-setuponly|-instonly] [-norebuild] [-clean]"
+#    echo "              [-ingbuild] [-r <rootdir>] [ -j <piccolo_jobs> ]"
+#    echo "              [ -wt <label> ] installation_code"
+#    trap - 0
+#    exit 1
+#}
 
 function usage()
 {
-    echo "Usage: testit [-testonly|-setuponly|-instonly] [-norebuild] [-clean]"
-    echo "              [-ingbuild] [-r <rootdir>] [ -j <piccolo_jobs> ]"
-    echo "              [ -wt <label> ] installation_code"
+    echo "Usage: testit installation_code"
     trap - 0
     exit 1
 }
@@ -137,191 +150,87 @@
     return 0
 }
 
-#
-# update_tests - Pull head revs of tests
-#
-function update_tests()
-{
-    label=$1
+# Main routine
+#while [ $# != 0 ]
+#do
+#    case $1 in 
+#        -instonly ) 
+#	    TEST=false
+#	    SETUP=false
+#	    shift
+#	    ;;
+#	-setuponly)
+#	    TEST=false
+#	    INSTALL=false
+#	    shift
+#	    ;;
+#        -testonly)
+#	    INSTALL=false
+#	    SETUP=false
+#	    II_INSTALLATION=`ingprenv II_INSTALLATION`
+#	    shift
+#	    ;;
+#	-norebuild)
+#	    REBUILD=false
+#	    shift
+#	    ;;
+#	-clean)
+#	    CLEAN=true
+#	    shift
+#	    ;;
+#	-r)
+#	    srcroot=$2
+#	    shift ; shift
+#	    ;;
+#	-ingbuild)
+#	    INGBUILD=true
+#	    RPMARCH=""
+#	    shift
+#	    ;;
+#        -j)
+#            pjobs="$2"
+#            if [ "$pjobs" -eq 0 ]; then
+#                echo -e "Invalid argument:\n\t$1 $2"
+#                usage
+#                # exit 1
+#            fi
+#            shift ; shift
+#            ;;
+#	-wt)
+#	    testlabel=$2
+#	    shift ; shift
+#	    ;;
+#         *)
+#	    case $1 in
+#		[A-Z][A-Z,0-9])
+#	    	    II_INSTALLATION=$1
+#	    	    shift
+#	    	    ;;
+#		*)
+#		    echo "$1 is an invalid installation ID"
+#		    usage
+#		    # exit 1
+#		    ;;
+#	    esac
+#	    ;;
+#    esac
+#done
 
-    map_ok=false
-    needlist=need.$$
-    # Catch the errors
-    trap err ERR 1
+TEST=false
+SETUP=false
+INGBUILD=true
+RPMARCH=""
 
-    # Check we at least have some tests
-    [ -d "$ING_TST" ]
+case $1 in
+	[A-Z][A-Z,0-9])
+		II_INSTALLATION=$1
+		;;
+	*)
+		echo "$1 is an invalid installation ID"
+		usage
+		;;
+esac
 
-    # test mappings
-    [ "$MAPPATH" ] &&
-    {
-	pushd $ING_TST && \
-	p here >& /dev/null && \
-	map_ok=true
-    }
-
-    # try default qa mapfile
-    [ -r ${srcroot}/piccolo/client.map.qa ] && ! $map_ok &&
-    {
-	MAPPATH=${srcroot}/piccolo/client.map.qa
-	pushd $ING_TST && \
-	p here >& /dev/null && \
-	map_ok=true
-    }
-
-    # pull HR if we can
-    if $map_ok
-    then
-        if [ -z "$label" ]; then
-		echo "Getting head revs. of the tests" 
-		p need > $needlist
-	else
-		echo "Getting label $label for the tests" 
-		p label -p $label > $needlist
-	fi
-        if [ $pjobs -eq 1 ]; then
-            p get -l $needlist > get.out 2>&1
-        else
-            lines=`wc -l $needlist | awk '{print $1}'`
-            jlines=`expr $lines / $pjobs + 1`
-            rm -f x?? get.*.out
-            split -$jlines $needlist
-            for file in `ls x??`; do
-                $P get -l $file > get.$file.out 2>&1 &
-            done
-            wait
-            cat get.*.out > get.out
-            rm -f x?? get.*.out
-        fi
-	rm $needlist
-	return 0
-    else
-	return 1
-    fi
-	
-	
-	
-}
-
-function setup_tests()
-{
-    maptmplt=${srcroot}/piccolo/clqa.tmplt
-    mapfile=${srcroot}/piccolo/client.map.qa
-    setup_ok=true
-
-    # Catch the errors
-    trap err ERR 1
-
-    echo "Setting up ingtst client..."
-    # Check we have all we need
-    [ -z "${ING_TST}" ] && echo "ING_TST not set" && setup_ok=false
-
-    echo "Creating $ING_TST..."
-    mkdir -p ${ING_TST} || setup_ok=false 
-
-    cd ${ING_TST}
-    ING_TSTp=`pwd -P`
-
-    if [ -r "${MAPPATH}" ]
-    then
-	echo "Using MAPPATH=${MAPPATH}"
-    elif [ -r "$mapfile" ]
-    then
-	export MAPPATH=${srcroot}/piccolo/client.map.qa
-	echo "Using MAPPATH=${MAPPATH}"
-    elif [ -r "$maptmplt" ]
-    then
-	echo "Creating $mapfile"
-	cat "$maptmplt" | sed -e s,HOSTNAME,$host,g -e s,TEST_LOC,$ING_TSTp,g \
-		> "$mapfile"
-	export MAPPATH=${srcroot}/piccolo/client.map.qa
-        echo "Using MAPPATH=${MAPPATH}"
-    else
-	echo "Could not locate client.map.qa or clqa.tmplt"
-	setup_ok=false
-    fi
-	
-    if ! $setup_ok
-    then
-	echo "Could not setup ingtst client..."
-	echo "Aborting."
-	exit 1
-    fi
-
-    # Subscribe to ingtst libraries...
-    cd "$ING_TST" && \
-	p sdirs -d > sdir.tst && \
-	p subscribe -l sdir.tst > subscribe.out 2>&1 || \
-	return 1
-
-    return 0
-}
-
-# Main routine
-while [ $# != 0 ]
-do
-    case $1 in 
-        -instonly ) 
-	    TEST=false
-	    SETUP=false
-	    shift
-	    ;;
-	-setuponly)
-	    TEST=false
-	    INSTALL=false
-	    shift
-	    ;;
-        -testonly)
-	    INSTALL=false
-	    SETUP=false
-	    II_INSTALLATION=`ingprenv II_INSTALLATION`
-	    shift
-	    ;;
-	-norebuild)
-	    REBUILD=false
-	    shift
-	    ;;
-	-clean)
-	    CLEAN=true
-	    shift
-	    ;;
-	-r)
-	    srcroot=$2
-	    shift ; shift
-	    ;;
-	-ingbuild)
-	    INGBUILD=true
-	    RPMARCH=""
-	    shift
-	    ;;
-        -j)
-            pjobs="$2"
-            if [ "$pjobs" -eq 0 ]; then
-                echo -e "Invalid argument:\n\t$1 $2"
-                usage
-                # exit 1
-            fi
-            shift ; shift
-            ;;
-	-wt)
-	    testlabel=$2
-	    shift ; shift
-	    ;;
-         *)
-	    case $1 in
-		[A-Z][A-Z,0-9])
-	    	    II_INSTALLATION=$1
-	    	    shift
-	    	    ;;
-		*)
-		    echo "$1 is an invalid installation ID"
-		    usage
-		    # exit 1
-		    ;;
-	    esac
-	    ;;
-    esac
-done
 [ -z "$II_INSTALLATION" ] && 
 {
     echo "installation_code not specified"
@@ -337,14 +246,6 @@
     exit 1
 }
 
-case $lib in
-    main)
-	productname=ingres2006
-	;;
-    ingresr30 | ingres2006r2 | ingres2006r3)
-	productname=ingres2006
-	;;
-esac
 set - `cat $ING_ROOT/build/version.rel`
 release=$2
 nptlbuild=`head -1 $ING_ROOT/build/version.rel |cut -d')' -f2`
@@ -419,14 +320,59 @@
 
 tardir=${productname}-$release-$buildno-$desc
 
-    
-if [ `whoami`  != "ingres" ]
+if [ ! -f $ING_ROOT/release/$tardir/ingres.tar ]
 then
- echo "You must be user 'ingres' to run this setup script"
- echo ""
- exit 2
+   echo "Creating installation tar file."
+   mksaveset
 fi
 
+if [ ! -f $ING_ROOT/release/tools.tar ]
+then
+   echo "Creating tools tar file."
+    pushd $ING_ROOT/release
+    tartools -a
+    tartools tools.tar
+    popd
+fi
+
+if [ ! -d "$ING_ROOT/install/$II_INSTALLATION" ]
+then
+   echo "Creating installation instance directory."
+   mkdir ${ING_ROOT}/install/${II_INSTALLATION}
+fi
+
+export II_SYSTEM=${ING_ROOT}/install/${II_INSTALLATION}
+
+export ING_TOOLS=$II_SYSTEM/tools
+export ING_TST=$ING_ROOT/ingtst
+
+export TST_CFG=$ING_TST/suites/handoffqa
+export TST_LISTEXEC=$ING_TST/suites/handoffqa
+export TST_DOC=$ING_TST/suites/doc
+export TST_DCL=$ING_TST/suites/dcl
+export TST_SHELL=$ING_TST/suites/shell
+export TST_TESTENV=$ING_TST
+export TST_INIT=$ING_TST/basis/init
+export TST_DATA=$ING_TST/gcf/gcc/data
+export TST_STRESS=$ING_TST/stress
+export SEP_TIMEOUT=600
+export II_DATE_CENTURY_BOUNDARY=10
+export TST_TOOLS=$ING_TOOLS/bin
+export TOOLS_DIR=$ING_TOOLS
+export TST_TESTOOLS=$ING_TST/testtool
+export TST_SEP=$ING_TOOLS/files
+export PEDITOR=$TST_TOOLS/peditor
+export SEP_DIFF_SLEEP=10
+
+if [ ! -f ${II_SYSTEM}/resp.txt ]
+then
+   echo "Creating resp.txt file."
+   cat << ! > $II_SYSTEM/resp.txt
+LOG_KBYTES=200000
+START_ON_BOOT=NO
+!
+fi
+
 [ -n "$RPMARCH" ] &&
 {
     [ -d $ING_ROOT/rpm ] ||
@@ -588,20 +534,6 @@
 then
     timestamp begin "test setup"
 
-    # Check if we have any tests at all, set them up if we don't
-    [ "$ING_TST" ] && [ ! -d "$ING_TST/suites/shell" ] &&
-    {
-	if ! setup_tests
-	then
-	    echo "Failed to setup ingtst client"
-	    echo Aborting
-	    exit 1
-	fi
-    }
-
-    # Get latest tests if we can
-    [ "$MAPPATH" ] || [ -r ${srcroot}/piccolo/client.map.qa ] && update_tests $testlabel
-	
     # Check tools exist
     [ -x "$ING_TOOLS/bin/sep" ] || setup_tools
     set_perms ||
@@ -623,7 +555,7 @@
 then
 	timestamp begin "handoffQA"
 	cd $TST_OUTPUT
-	qasetuser testenv sh ${srcroot}/bin/hoqa 
+	qasetuser testenv sh ${srcroot}/hoqa 
 	ingstop
 	timestamp end "handoffQA"
 




More information about the svn-commits mailing list