diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2007-08-31 16:12:51 +0200 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2007-08-31 16:12:51 +0200 |
commit | 26f6d3f6fc4393ae58e6ab69520d6ab4d71f4204 (patch) | |
tree | 43c12cbabaa753865394c79fa2efac821eeb43b0 /storage | |
parent | 72759bc2ec7d42d2cb6742466515ec725b4a0078 (diff) | |
download | mariadb-git-26f6d3f6fc4393ae58e6ab69520d6ab4d71f4204.tar.gz |
ndb autotest
add --tag
remove prepended mysql-
add conf-test.cnf
add embryo upgrade-boot.sh
storage/ndb/test/run-test/Makefile.am:
add test test conf
storage/ndb/test/run-test/autotest-boot.sh:
add --tag to autotest
remove "extra" appended mysql- to all scripts
storage/ndb/test/run-test/autotest-run.sh:
remove extra "mysql-"
storage/ndb/test/run-test/conf-test.cnf:
New BitKeeper file ``storage/ndb/test/run-test/conf-test.cnf''
storage/ndb/test/run-test/upgrade-boot.sh:
New BitKeeper file ``storage/ndb/test/run-test/upgrade-boot.sh''
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/test/run-test/Makefile.am | 2 | ||||
-rw-r--r-- | storage/ndb/test/run-test/autotest-boot.sh | 35 | ||||
-rw-r--r-- | storage/ndb/test/run-test/autotest-run.sh | 2 | ||||
-rw-r--r-- | storage/ndb/test/run-test/conf-test.cnf | 26 | ||||
-rw-r--r-- | storage/ndb/test/run-test/upgrade-boot.sh | 218 |
5 files changed, 275 insertions, 8 deletions
diff --git a/storage/ndb/test/run-test/Makefile.am b/storage/ndb/test/run-test/Makefile.am index ef9d2a9098d..65aa62d11f0 100644 --- a/storage/ndb/test/run-test/Makefile.am +++ b/storage/ndb/test/run-test/Makefile.am @@ -23,7 +23,7 @@ include $(top_srcdir)/storage/ndb/config/type_ndbapitools.mk.am test_PROGRAMS = atrt test_DATA=daily-basic-tests.txt daily-devel-tests.txt 16node-tests.txt \ conf-ndbmaster.cnf \ - conf-dl145a.cnf test-tests.txt + conf-dl145a.cnf test-tests.txt conf-test.cnf test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ atrt-clear-result.sh autotest-run.sh diff --git a/storage/ndb/test/run-test/autotest-boot.sh b/storage/ndb/test/run-test/autotest-boot.sh index 31f611460ec..1df3a26cc8a 100644 --- a/storage/ndb/test/run-test/autotest-boot.sh +++ b/storage/ndb/test/run-test/autotest-boot.sh @@ -24,7 +24,10 @@ verbose=0 do_clone=yes build=yes +tag= conf= +extra_args= +extra_clone= LOCK=$HOME/.autotest-lock ############################ @@ -40,6 +43,8 @@ do --clone=*) clone=`echo $1 | sed s/--clone=//`;; --version) echo $VERSION; exit;; --conf=*) conf=`echo $1 | sed s/--conf=//`;; + --tag=*) tag=`echo $1 | sed s/--tag=//`;; + --*) echo "Unknown arg: $1";; *) RUN=$*;; esac shift @@ -52,14 +57,20 @@ done ################################# if [ -z "$conf" ] then - conf=`pwd`/autotest.conf + if [ -f "`pwd`/autotest.conf" ] + then + conf="`pwd`/autotest.conf" + elif [ -f "$HOME/autotest.conf" ] + then + conf="$HOME/autotest.conf" + fi fi if [ -f $conf ] then . $conf else - echo "Can't find config file: $conf" + echo "Can't find config file: >$conf<" exit fi @@ -92,7 +103,7 @@ fi # Setup the clone source location # #################################### -src_clone=$src_clone_base-$clone +src_clone=${src_clone_base}${clone} ####################################### # Check to see if the lock file exists# @@ -125,7 +136,14 @@ fi # You can add more to this path# ################################ -dst_place=${build_dir}/clone-mysql-$clone-$DATE.$$ +if [ -z "$tag" ] +then + dst_place=${build_dir}/clone-$clone-$DATE.$$ +else + dst_place=${build_dir}/clone-$tag-$DATE.$$ + extra_args="$extra_args --clone=$tag" + extra_clone="-r$tag" +fi ######################################### # Delete source and pull down the latest# @@ -134,7 +152,12 @@ dst_place=${build_dir}/clone-mysql-$clone-$DATE.$$ if [ "$do_clone" ] then rm -rf $dst_place - bk clone $src_clone $dst_place + if [ `echo $src_clone | grep -c 'file:\/\/'` = 1 ] + then + bk clone -l $extra_clone $src_clone $dst_place + else + bk clone $extra_clone $src_clone $dst_place + fi fi ########################################## @@ -156,7 +179,7 @@ fi ################################ script=$install_dir/mysql-test/ndb/autotest-run.sh -$script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock +sh -x $script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock $extra_args if [ "$build" ] then diff --git a/storage/ndb/test/run-test/autotest-run.sh b/storage/ndb/test/run-test/autotest-run.sh index 34c3fe53949..cf1519a6245 100644 --- a/storage/ndb/test/run-test/autotest-run.sh +++ b/storage/ndb/test/run-test/autotest-run.sh @@ -246,7 +246,7 @@ cd $res_dir echo "date=$DATE" > info.txt echo "suite=$RUN" >> info.txt -echo "clone=mysql-$clone" >> info.txt +echo "clone=$clone" >> info.txt echo "arch=$target" >> info.txt find . | xargs chmod ugo+r diff --git a/storage/ndb/test/run-test/conf-test.cnf b/storage/ndb/test/run-test/conf-test.cnf new file mode 100644 index 00000000000..e528eeb1d8b --- /dev/null +++ b/storage/ndb/test/run-test/conf-test.cnf @@ -0,0 +1,26 @@ +[atrt] +basedir = CHOOSE_dir +baseport = 14000 +clusters = .2node + +[ndb_mgmd] + +[mysqld] +skip-innodb +skip-bdb + +[cluster_config.2node] +ndb_mgmd = CHOOSE_host1 +ndbd = CHOOSE_host2,CHOOSE_host3 +ndbapi= CHOOSE_host1,CHOOSE_host1,CHOOSE_host1 + +NoOfReplicas = 2 +IndexMemory = 25M +DataMemory = 100M +BackupMemory = 64M +MaxNoOfConcurrentScans = 100 +MaxNoOfSavedMessages= 1000 +SendBufferMemory = 2M +NoOfFragmentLogFiles = 4 +FragmentLogFileSize = 64M + diff --git a/storage/ndb/test/run-test/upgrade-boot.sh b/storage/ndb/test/run-test/upgrade-boot.sh new file mode 100644 index 00000000000..d3542166551 --- /dev/null +++ b/storage/ndb/test/run-test/upgrade-boot.sh @@ -0,0 +1,218 @@ +#!/bin/sh +############################################################# +# This script created by Jonas does the following # +# Cleans up clones and pevious builds, pulls new clones, # +# builds, deploys, configures the tests and launches ATRT # +############################################################# + +############### +#Script setup # +############## + +save_args=$* +VERSION="upgrade-boot.sh version 1.00" + +DATE=`date '+%Y-%m-%d'` +HOST=`hostname -s` +export DATE HOST + +set -e + +echo "`date` starting: $*" + +verbose=0 +do_clone=yes +build=yes + +tag0= +tag1= +conf= +extra_args= +extra_clone= +LOCK=$HOME/.autotest-lock + +############################ +# Read command line entries# +############################ + +while [ "$1" ] +do + case "$1" in + --no-clone) do_clone="";; + --no-build) build="";; + --verbose) verbose=`expr $verbose + 1`;; + --clone=*) clone0=`echo $1 | sed s/--clone=//`;; + --clone0=*) clone0=`echo $1 | sed s/--clone0=//`;; + --clone1=*) clone1=`echo $1 | sed s/--clone1=//`;; + --version) echo $VERSION; exit;; + --conf=*) conf=`echo $1 | sed s/--conf=//`;; + --tag=*) tag0=`echo $1 | sed s/--tag=//`;; + --tag0=*) tag0=`echo $1 | sed s/--tag0=//`;; + --tag1=*) tag1=`echo $1 | sed s/--tag1=//`;; + --*) echo "Unknown arg: $1";; + *) RUN=$*;; + esac + shift +done + +if [ -z "$clone1" ] +then + clone1=$clone0 +fi + +if [ -z "$tag0" ] +then + echo "No tag0 specified" + exit +fi + +if [ -z "$tag1" ] +then + echo "No tag1 specified" + exit +fi + +################################# +#Make sure the configfile exists# +#if it does not exit. if it does# +# (.) load it # +################################# +if [ -z "$conf" ] +then + if [ -f "`pwd`/autotest.conf" ] + then + conf="`pwd`/autotest.conf" + elif [ -f "$HOME/autotest.conf" ] + then + conf="$HOME/autotest.conf" + fi +fi + +if [ -f $conf ] +then + . $conf +else + echo "Can't find config file: >$conf<" + exit +fi + +############################### +# Validate that all interesting +# variables where set in conf +############################### +vars="src_clone_base install_dir build_dir" +for i in $vars +do + t=`echo echo \\$$i` + if [ -z "`eval $t`" ] + then + echo "Invalid config: $conf, variable $i is not set" + exit + fi +done + +############################### +#Print out the enviroment vars# +############################### + +if [ $verbose -gt 0 ] +then + env +fi + +#################################### +# Setup the lock file name and path# +# Setup the clone source location # +#################################### + +src_clone0=${src_clone_base}${clone0} +src_clone1=${src_clone_base}${clone1} + +####################################### +# Check to see if the lock file exists# +# If it does exit. # +####################################### + +if [ -f $LOCK ] +then + echo "Lock file exists: $LOCK" + exit 1 +fi + +####################################### +# If the lock file does not exist then# +# create it with date and run info # +####################################### + +echo "$DATE $RUN" > $LOCK + +############################# +#If any errors here down, we# +# trap them, and remove the # +# Lock file before exit # +############################# +if [ `uname -s` != "SunOS" ] +then + trap "rm -f $LOCK" ERR +fi + +# You can add more to this path# +################################ + +dst_place0=${build_dir}/clone-$tag0-$DATE.$$ +dst_place1=${build_dir}/clone-$tag1-$DATE.$$ + +######################################### +# Delete source and pull down the latest# +######################################### + +if [ "$do_clone" ] +then + rm -rf $dst_place0 $dst_place1 + if [ `echo $src_clone0 | grep -c 'file:\/\/'` = 1 ] + then + bk clone -l -r$tag0 $src_clone0 $dst_place0 + else + bk clone -r$tag0 $src_clone0 $dst_place0 + fi + + if [ `echo $src_clone1 | grep -c 'file:\/\/'` = 1 ] + then + bk clone -l -r$tag1 $src_clone1 $dst_place1 + else + bk clone -r$tag1 $src_clone1 $dst_place1 + fi +fi + +########################################## +# Build the source, make installs, and # +# create the database to be rsynced # +########################################## +install_dir0=$install_dir/$tag0 +install_dir1=$install_dir/$tag1 +if [ "$build" ] +then + cd $dst_place0 + rm -rf $install_dir0 + BUILD/compile-ndb-autotest --prefix=$install_dir0 + make install + + cd $dst_place1 + rm -rf $install_dir1 + BUILD/compile-ndb-autotest --prefix=$install_dir1 + make install +fi + + +################################ +# Start run script # +################################ + +script=$install_dir1/mysql-test/ndb/upgrade-run.sh +$script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock $extra_args + +if [ "$build" ] +then + rm -rf $dst_place0 $dst_place1 +fi +rm -f $LOCK |