Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5189e9dd
Commit
5189e9dd
authored
May 25, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb autotest - merge jonathans script changes
parent
c448ab53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
191 additions
and
49 deletions
+191
-49
ndb/test/run-test/ndb-autotest.sh
ndb/test/run-test/ndb-autotest.sh
+191
-49
No files found.
ndb/test/run-test/ndb-autotest.sh
View file @
5189e9dd
#!/bin/sh
#!/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
=
$*
save_args
=
$*
VERSION
=
"ndb-autotest.sh version 1.04"
VERSION
=
"ndb-autotest.sh version 1.04"
DATE
=
`
date
'+%Y-%m-%d'
`
DATE
=
`
date
'+%Y-%m-%d'
`
export
DATE
HOST
=
`
hostname
-s
`
export
DATE HOST
set
-e
set
-e
ulimit
-Sc
unlimited
ulimit
-Sc
unlimited
...
@@ -14,21 +24,33 @@ echo "`date` starting: $*"
...
@@ -14,21 +24,33 @@ echo "`date` starting: $*"
RSYNC_RSH
=
ssh
RSYNC_RSH
=
ssh
export
RSYNC_RSH
export
RSYNC_RSH
verbose
=
0
do_clone
=
yes
do_clone
=
yes
build
=
yes
build
=
yes
deploy
=
yes
deploy
=
yes
run_test
=
yes
config
=
yes
report
=
yes
clone
=
5.0-ndb
clone
=
5.0-ndb
RUN
=
"daily-basic daily-devel"
RUN
=
"daily-basic daily-devel"
conf
=
autotest.conf
conf
=
autotest.conf
############################
# Read command line entries#
############################
while
[
"
$1
"
]
while
[
"
$1
"
]
do
do
case
"
$1
"
in
case
"
$1
"
in
--no-clone
)
do_clone
=
""
;;
--no-clone
)
do_clone
=
""
;;
--no-build
)
build
=
""
;;
--no-build
)
build
=
""
;;
--no-deploy
)
deploy
=
""
;;
--no-deploy
)
deploy
=
""
;;
--clone
=
*
)
clone
=
`
echo
$1
|
sed
s/--clone
=
//
`
;;
--no-test
)
run_test
=
""
;;
--no-config
)
config
=
""
;;
--no-report
)
report
=
""
;;
--verbose
)
verbose
=
`
expr
$verbose
+ 1
`
;;
--clone
=
*
)
clone
=
`
echo
$1
|
sed
s/--clone
=
//
`
;;
--conf
=
*
)
conf
=
`
echo
$1
|
sed
s/--conf
=
//
`
;;
--conf
=
*
)
conf
=
`
echo
$1
|
sed
s/--conf
=
//
`
;;
--version
)
echo
$VERSION
;
exit
;;
--version
)
echo
$VERSION
;
exit
;;
*
)
RUN
=
$*
;;
*
)
RUN
=
$*
;;
...
@@ -36,6 +58,12 @@ do
...
@@ -36,6 +58,12 @@ do
shift
shift
done
done
#################################
#Make sure the configfile exists#
#if it does not exit. if it does#
# (.) load it #
#################################
if
[
-f
$conf
]
if
[
-f
$conf
]
then
then
.
$conf
.
$conf
...
@@ -44,32 +72,92 @@ else
...
@@ -44,32 +72,92 @@ else
exit
exit
fi
fi
env
###############################
# Validate that all interesting
# variables where set in conf
###############################
vars
=
"target base_dir src_clone install_dir build_dir hosts configure"
if
[
"
$report
"
]
then
vars
=
"
$vars
result_host result_path"
fi
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 #
####################################
LOCK
=
$HOME
/.autotest-lock
LOCK
=
$HOME
/.autotest-lock
src_clone
=
$src_clone_base
-
$clone
src_clone
=
$src_clone_base
-
$clone
#######################################
# Check to see if the lock file exists#
# If it does exit. #
#######################################
if
[
-f
$LOCK
]
if
[
-f
$LOCK
]
then
then
echo
"Lock file exists:
$LOCK
"
echo
"Lock file exists:
$LOCK
"
exit
1
exit
1
fi
fi
#######################################
# If the lock file does not exist then#
# create it with date and run info #
#######################################
echo
"
$DATE
$RUN
"
>
$LOCK
echo
"
$DATE
$RUN
"
>
$LOCK
#############################
#If any errors here down, we#
# trap them, and remove the #
# Lock file before exit #
#############################
trap
"rm -f
$LOCK
"
ERR
trap
"rm -f
$LOCK
"
ERR
# You can add more to this path#
################################
dst_place
=
${
build_dir
}
/clone-mysql-
$clone
-
$DATE
dst_place
=
${
build_dir
}
/clone-mysql-
$clone
-
$DATE
#########################################
# Delete source and pull down the latest#
#########################################
if
[
"
$do_clone
"
]
if
[
"
$do_clone
"
]
then
then
rm
-rf
$dst_place
rm
-rf
$dst_place
bk clone
$src_clone
$dst_place
bk clone
$src_clone
$dst_place
fi
fi
##########################################
# Build the source, make installs, and #
# create the database to be rsynced #
##########################################
if
[
"
$build
"
]
if
[
"
$build
"
]
then
then
cd
$dst_place
cd
$dst_place
rm
-rf
$
run
_dir
/
*
rm
-rf
$
install
_dir
/
*
if
[
-x
BUILD/autorun.sh
]
if
[
-x
BUILD/autorun.sh
]
then
then
./BUILD/autorun.sh
./BUILD/autorun.sh
...
@@ -84,16 +172,19 @@ then
...
@@ -84,16 +172,19 @@ then
(
cd
bdb/dist
;
sh s_all
)
(
cd
bdb/dist
;
sh s_all
)
fi
fi
fi
fi
eval
$configure
--prefix
=
$
run
_dir
eval
$configure
--prefix
=
$
install
_dir
make
make
make
install
make
install
(
cd
$
run_dir
;
./bin/mysql_install_db
)
(
cd
$
install_dir
;
./bin/mysql_install_db
)
# This will be rsynced to all
fi
fi
###
################################
# check script version
# check script version. If the #
#
# version is old, replace it #
script
=
$run_dir
/mysql-test/ndb/ndb-autotest.sh
# and restart #
################################
script
=
$install_dir
/mysql-test/ndb/ndb-autotest.sh
if
[
-x
$script
]
if
[
-x
$script
]
then
then
$script
--version
>
/tmp/version.
$$
$script
--version
>
/tmp/version.
$$
...
@@ -105,21 +196,34 @@ rm -f /tmp/version.$$
...
@@ -105,21 +196,34 @@ rm -f /tmp/version.$$
if
[
$match
-eq
0
]
if
[
$match
-eq
0
]
then
then
echo
"Incorrect script version...restarting"
echo
"Incorrect script version...restarting"
cp
$
run
_dir
/mysql-test/ndb/ndb-autotest.sh /tmp/at.
$$
.sh
cp
$
install
_dir
/mysql-test/ndb/ndb-autotest.sh /tmp/at.
$$
.sh
rm
-rf
$
run
_dir
$dst_place
rm
-rf
$
install
_dir
$dst_place
sh /tmp/at.
$$
.sh
$save_args
sh /tmp/at.
$$
.sh
$save_args
exit
exit
fi
fi
# Check that all interesting files are present
###############################################
test_dir
=
$run_dir
/mysql-test/ndb
# Check that all interesting files are present#
###############################################
test_dir
=
$install_dir
/mysql-test/ndb
atrt
=
$test_dir
/atrt
atrt
=
$test_dir
/atrt
html
=
$test_dir
/make-html-reports.sh
html
=
$test_dir
/make-html-reports.sh
mkconfig
=
$run_dir
/mysql-test/ndb/make-config.sh
mkconfig
=
$install_dir
/mysql-test/ndb/make-config.sh
##########################
#Setup bin and test paths#
##########################
PATH
=
$
run
_dir
/bin:
$test_dir
:
$PATH
PATH
=
$
install
_dir
/bin:
$test_dir
:
$PATH
export
PATH
export
PATH
###########################
# This will filter out all#
# the host that did not #
# respond. Called below #
###########################
filter
(){
filter
(){
neg
=
$1
neg
=
$1
shift
shift
...
@@ -130,18 +234,22 @@ filter(){
...
@@ -130,18 +234,22 @@ filter(){
done
done
}
}
###
###
#########################
# check ndb_cpcc fail hosts
# check ndb_cpcc fail hosts
#
#
#
###########################
ndb_cpcc
$hosts
|
awk
'{ if($1=="Failed"){ print;}}'
>
/tmp/failed.
$DATE
ndb_cpcc
$hosts
|
awk
'{ if($1=="Failed"){ print;}}'
>
/tmp/failed.
$DATE
filter /tmp/failed.
$DATE
$hosts
>
/tmp/hosts.
$DATE
filter /tmp/failed.
$DATE
$hosts
>
/tmp/hosts.
$DATE
hosts
=
`
cat
/tmp/hosts.
$DATE
`
hosts
=
`
cat
/tmp/hosts.
$DATE
`
#############################
# Push bin and test to hosts#
#############################
if
[
"
$deploy
"
]
if
[
"
$deploy
"
]
then
then
for
i
in
$hosts
for
i
in
$hosts
do
do
rsync
-a
--delete
--force
--ignore-errors
$
run_dir
/
$i
:
$run
_dir
rsync
-a
--delete
--force
--ignore-errors
$
install_dir
/
$i
:
$install
_dir
ok
=
$?
ok
=
$?
if
[
$ok
-ne
0
]
if
[
$ok
-ne
0
]
then
then
...
@@ -150,7 +258,6 @@ then
...
@@ -150,7 +258,6 @@ then
fi
fi
done
done
fi
fi
rm
-f
/tmp/build.
$DATE
.tgz
###
###
# handle scp failed hosts
# handle scp failed hosts
...
@@ -159,9 +266,11 @@ filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
...
@@ -159,9 +266,11 @@ filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
hosts
=
`
cat
/tmp/hosts.
$DATE
`
hosts
=
`
cat
/tmp/hosts.
$DATE
`
cat
/tmp/failed.
$DATE
>
/tmp/filter_hosts.
$$
cat
/tmp/failed.
$DATE
>
/tmp/filter_hosts.
$$
###
#############################
# functions for running atrt
# Function for replacing the#
#
# choose host with real host#
# names. Note $$ = PID #
#############################
choose
(){
choose
(){
SRC
=
$1
SRC
=
$1
TMP1
=
/tmp/choose.
$$
TMP1
=
/tmp/choose.
$$
...
@@ -182,16 +291,25 @@ choose(){
...
@@ -182,16 +291,25 @@ choose(){
}
}
choose_conf
(){
choose_conf
(){
host
=
`
hostname
-s
`
if
[
-f
$test_dir
/conf-
$1
-
$HOST
.txt
]
if
[
-f
$test_dir
/conf-
$1
-
$host
.txt
]
then
then
echo
"
$test_dir
/conf-
$1
-
$HOST
.txt"
echo
"
$test_dir
/conf-
$1
-
$host
.txt"
echo
"
$test_dir
/conf-
$1
-
$host
.txt"
elif
[
-f
$test_dir
/conf-
$1
.txt
]
elif
[
-f
$test_dir
/conf-
$1
.txt
]
then
then
echo
"
$test_dir
/conf-
$1
.txt"
echo
"
$test_dir
/conf-
$1
.txt"
else
echo
"Unable to find conf file looked for"
1>&2
echo
"
$testdir
/conf-
$1
-host.txt and"
1>&2
echo
"
$testdir
/conf-
$1
.txt"
1>&2
exit
fi
fi
}
}
######################################
# Starts ATRT and gives it the right #
# command line options. after it #
# Gathers results and moves them #
######################################
start
(){
start
(){
rm
-rf
report.txt result
*
log.txt
rm
-rf
report.txt result
*
log.txt
$atrt
-v
-v
-r
-R
--log-file
=
log.txt
--testcase-file
=
$test_dir
/
$2
-tests
.txt &
$atrt
-v
-v
-r
-R
--log-file
=
log.txt
--testcase-file
=
$test_dir
/
$2
-tests
.txt &
...
@@ -207,17 +325,31 @@ start(){
...
@@ -207,17 +325,31 @@ start(){
cd
..
cd
..
p2
=
`
pwd
`
p2
=
`
pwd
`
cd
..
cd
..
tar
cfz /tmp/res.
$$
.tgz
`
basename
$p2
`
/
$DATE
if
[
"
$report
"
]
scp /tmp/res.
$$
.tgz
$result_host
:
$result_path
/res.
$DATE
.
`
hostname
-s
`
.
$2
.
$$
.tgz
then
rm
-f
/tmp/res.
$$
.tgz
tar
cfz /tmp/res.
$2
.
$$
.tgz
`
basename
$p2
`
/
$DATE
scp /tmp/res.
$2
.
$$
.tgz
\
$result_host
:
$result_path
/res.
$DATE
.
$HOST
.
$2
.
$$
.tgz
rm
-f
/tmp/res.
$2
.
$$
.tgz
fi
}
}
#########################################
# Count how many computers we have ready#
#########################################
count_hosts
(){
count_hosts
(){
cnt
=
`
grep
"CHOOSE_host"
$1
|
cnt
=
`
grep
"CHOOSE_host"
$1
|
awk
'{for(i=1; i<=NF;i++) \
awk
'{for(i=1; i<=NF;i++) if(match($i, "CHOOSE_host") > 0) print $i;}'
|
if(match($i, "CHOOSE_host") > 0) print $i;}'
|
sort
|
uniq
|
wc
-l
`
sort
|
uniq
|
wc
-l
`
echo
$cnt
echo
$cnt
}
}
#######################################################
# Calls: Choose #
# Choose_host #
# Count_host #
# start #
# for each directory in the $RUN variable #
#######################################################
p
=
`
pwd
`
p
=
`
pwd
`
for
dir
in
$RUN
for
dir
in
$RUN
...
@@ -228,26 +360,36 @@ do
...
@@ -228,26 +360,36 @@ do
res_dir
=
$base_dir
/result-
$dir
-mysql-
$clone
-
$target
/
$DATE
res_dir
=
$base_dir
/result-
$dir
-mysql-
$clone
-
$target
/
$DATE
mkdir
-p
$run_dir
$res_dir
mkdir
-p
$run_dir
$res_dir
rm
-rf
$res_dir
/
*
$run_dir
/
*
rm
-rf
$res_dir
/
*
cd
$run_dir
conf
=
`
choose_conf
$dir
`
count
=
`
count_hosts
$conf
`
if
[
"
$config
"
]
avail_hosts
=
`
filter /tmp/filter_hosts.
$$
$hosts
`
avail
=
`
echo
$avail_hosts
|
wc
-w
`
if
[
$count
-gt
$avail
]
then
then
rm
-rf
$run_dir
/
*
conf
=
`
choose_conf
$dir
`
count
=
`
count_hosts
$conf
`
avail_hosts
=
`
filter /tmp/filter_hosts.
$$
$hosts
`
avail
=
`
echo
$avail_hosts
|
wc
-w
`
if
[
$count
-gt
$avail
]
then
echo
"Not enough hosts"
echo
"Not enough hosts"
echo
"Needs:
$count
available:
$avail
(
$avail_hosts
)"
echo
"Needs:
$count
available:
$avail
(
$avail_hosts
)"
break
;
break
;
fi
fi
run_hosts
=
`
echo
$avail_hosts
|awk
'{for(i=1;i<='
$count
';i++)print $i;}'
`
run_hosts
=
`
echo
$avail_hosts
|
\
echo
$run_hosts
>>
/tmp/filter_hosts.
$$
awk
'{for(i=1;i<='
$count
';i++)print $i;}'
`
echo
$run_hosts
>>
/tmp/filter_hosts.
$$
cd
$run_dir
choose
$conf
$run_hosts
>
d.tmp
choose
$conf
$run_hosts
>
d.tmp
$mkconfig
d.tmp
$mkconfig
d.tmp
fi
start
$dir
-mysql-
$clone
-
$target
$dir
$res_dir
&
if
[
"
$run_test
"
]
then
start
$dir
-mysql-
$clone
-
$target
$dir
$res_dir
&
fi
done
done
cd
$p
cd
$p
rm
/tmp/filter_hosts.
$$
rm
/tmp/filter_hosts.
$$
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment