From: <ma...@us...> - 2006-10-26 20:13:01
|
Revision: 1574 http://svn.sourceforge.net/osdldbt/?rev=1574&view=rev Author: markwkm Date: 2006-10-26 13:12:53 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Extracted the portion of the script to export and install PostgreSQL from CVS into it's own script to facilitate multi-tier testing. Updated the test script to enable oprofile data collection as a command line argument. Other script tidiness. Modified Paths: -------------- trunk/dbt2/scripts/pgsql/test-pgsql.in Added Paths: ----------- trunk/dbt2/scripts/pgsql/install-source Added: trunk/dbt2/scripts/pgsql/install-source =================================================================== --- trunk/dbt2/scripts/pgsql/install-source (rev 0) +++ trunk/dbt2/scripts/pgsql/install-source 2006-10-26 20:12:53 UTC (rev 1574) @@ -0,0 +1,38 @@ +#!/bin/bash +# +# This file is released under the terms of the Artistic License. +# Please see the file LICENSE, included in this package, for details. +# +# Copyright (C) 2006 Mark Wong & Open Source Development Labs, Inc. +# +# Export PostgreSQL from CVS or install from specified directory, with +# priority given to the latter. +# + +if [ $# -lt 3 ]; then + echo "usage: install-source <DIR or DATE> <TMP DIR> <INSTALL DIR> [J FLAG]" + exit 1 +fi + +DATE=${1} +WORKING_DIR=${2} +INSTALL_DIR=${3} +J_FLAG=${4} + +MODULE="pgsql" + +if [ -d "${DATE}" ]; then + cd ${DATE} || exit 1 +else + cd ${WORKING_DIR} || exit 1 + cvs -z3 -d :pserver:an...@an...:/projects/cvsroot \ + export -D ${DATE} ${MODULE} || exit 1 + cd ${MODULE} || exit 1 +fi + +# Precautionary step, we don't need to see if 'make distclean' fails. +make distclean > /dev/null 2>&1 +./configure --enable-debug --enable-thread-safety \ + --prefix=${INSTALL_DIR} || exit 1 +make ${J_FLAG} || exit 1 +make install || exit 1 Property changes on: trunk/dbt2/scripts/pgsql/install-source ___________________________________________________________________ Name: svn:executable + * Modified: trunk/dbt2/scripts/pgsql/test-pgsql.in =================================================================== --- trunk/dbt2/scripts/pgsql/test-pgsql.in 2006-10-26 18:05:34 UTC (rev 1573) +++ trunk/dbt2/scripts/pgsql/test-pgsql.in 2006-10-26 20:12:53 UTC (rev 1574) @@ -7,6 +7,7 @@ # TOPDIR="@abs_top_srcdir@" +PGDIR="${TOPDIR}/scripts/pgsql" source ${TOPDIR}/scripts/dbt2_profile || exit 1 export PATH="$PATH:~/bin" @@ -25,7 +26,7 @@ DBCON=20 DURATION=120 -while getopts "C:c:fD:d:gj:np:rw:" OPT; do +while getopts "C:c:D:d:fgj:nop:rw:" OPT; do case ${OPT} in C) COMMENT=${OPTARG} @@ -54,6 +55,9 @@ n) NO_THINK="-n" ;; + o) + OPROFILE_FLAG="-o" + ;; p) TEST_PARAMETERS=${OPTARG} ;; @@ -83,22 +87,10 @@ fi # -# Export PostgreSQL from CVS. +# Export and install PostgreSQL from CVS. # -if [ ${SAVE} -eq 1 ]; then - PGSQL_DIR="${DATE}" - cd ${PGSQL_DIR} -else - cd ${WORKING_DIR} || exit 1 - cvs -z3 -d :pserver:an...@an...:/projects/cvsroot \ - export -D ${DATE} ${MODULE} || exit 1 - cd ${MODULE} || exit 1 -fi -make distclean -./configure --enable-debug --enable-thread-safety \ - --prefix=${INSTALL_DIR} || exit 1 -make ${J_FLAG} || exit 1 -make install || exit 1 +${PGDIR}/install-source ${DATE} ${WORKING_DIR} ${INSTALL_DIR} \ + ${J_FLAG} || exit 1 # # Configure kit and rebuild stored functions. @@ -124,14 +116,16 @@ if [ -d "${PGDATA}" ]; then if [ ${FORCE} -eq 1 ]; then - ${TOPDIR}/scripts/pgsql/destroy-installation -f + ${PGDIR}/destroy-installation -f else echo "'${PGDATA}' exists, cannot continue" exit 1 fi fi -cd ${TOPDIR}/scripts/pgsql || exit 1 +# +# Generate database data. +# if [ ${GENERATE_DATA} -eq 1 ]; then mkdir ${DBDATA}/${SCALE_FACTOR} || exit 1 ${TOPDIR}/src/datagen --pgsql -d ${DBDATA}/${SCALE_FACTOR} \ @@ -141,24 +135,32 @@ echo "'${DBDATA}/${SCALE_FACTOR}' doesn't exist" exit 1 fi +# +# Build the database. +# if [ -n ${LOAD_PARAMTERS} ]; then - ./build_db.sh -d ${DBDATA}/${SCALE_FACTOR} -t -b \ + ${PGDIR}/build_db.sh -d ${DBDATA}/${SCALE_FACTOR} -t -b \ -p "${LOAD_PARAMTERS}" || exit 1 else ./build_db.sh -d ${DBDATA}/${SCALE_FACTOR} -t -b || exit 1 fi -cd ${TOPDIR}/scripts || exit 1 +# +# Start the test. +# if [ -n ${TEST_PARAMETERS} ]; then - ./run_workload.sh -w ${SCALE_FACTOR} -d ${DURATION} -c ${DBCON} -s 100 \ - -p "${TEST_PARAMETERS}" -o -z "${COMMENT}" ${NO_THINK} || exit 1 + ${TOPDIR}/scripts/run_workload.sh -w ${SCALE_FACTOR} -d ${DURATION} \ + -c ${DBCON} -s 100 -p "${TEST_PARAMETERS}" ${OPROFILE_FLAG} \ + -z "${COMMENT}" ${NO_THINK} || exit 1 else - ./run_workload.sh -w ${SCALE_FACTOR} -d ${DURATION} -c ${DBCON} -s 100 \ - -o -z "${COMMENT}" ${NO_THINK} || exit 1 + ${TOPDIR}/scripts/run_workload.sh -w ${SCALE_FACTOR} -d ${DURATION} \ + -c ${DBCON} -s 100 ${OPROFILE_FLAG} \ + -z "${COMMENT}" ${NO_THINK} || exit 1 fi if [ ${FORCE} -eq 1 ]; then # - # If you don't know why the postmaster isn't shutting down, kill it. + # If you don't know why the postmaster isn't shutting down sometimes, + # so kill it. # killall -9 postmaster rm -f /tmp/.s.PGSQL.5432 @@ -169,7 +171,7 @@ # Cleaning up. # if [ -d "${PGDATA}" ]; then - ${TOPDIR}/scripts/pgsql/destroy-installation -f + ${PGDIR}/destroy-installation -f fi if [ ${SAVE} -eq 0 ]; then rm -rf ${WORKING_DIR}/${MODULE} || exit 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |