Skip to content

Commit d868cde

Browse files
committed
Bug#27179346: AUTOTEST: RESULTS ARE NOT COLLECTED IF ATRT FAILS
IN CONFIGURATION STAGE Description Autotest can only collect results after it's run. However, if atrt fails in the configuration stage, file configurations and core files never end up in results folder and hence are not collected as part of test run. Update autotest-run.sh such that when configuration stage fails, log and configuration file are stored in the result folder. Additionally fix atrt's mysql initialization code to return false if initialization fails (prevent silent error).
1 parent 871122b commit d868cde

File tree

3 files changed

+36
-15
lines changed

3 files changed

+36
-15
lines changed

storage/ndb/test/run-test/autotest-run.sh

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
##############
2727

2828
save_args=$*
29-
VERSION="autotest-run.sh version 1.15"
29+
VERSION="autotest-run.sh version 1.16"
3030

3131
DATE=`date '+%Y-%m-%d'`
3232
if [ `uname -s` != "SunOS" ]
@@ -364,20 +364,35 @@ if [ ${verbose} -gt 0 ] ; then
364364
fi
365365

366366
# Setup configuration
367-
$atrt ${atrt_defaults_group_suffix_arg} Cdq ${site_arg} ${clusters_arg} ${verbose_arg} $prefix my.cnf
368-
369-
# Start...
370-
args="${atrt_defaults_group_suffix_arg}"
371-
args="$args --report-file=report.txt"
372-
args="$args --log-file=log.txt"
373-
args="$args --testcase-file=$test_dir/$RUN-tests.txt"
374-
args="$args ${baseport_arg}"
375-
args="$args ${site_arg} ${clusters_arg}"
376-
args="$args $prefix"
377-
args="$args ${verbose_arg}"
378-
$atrt $args my.cnf || echo "ERROR: $?: $atrt $args my.cnf"
367+
$atrt ${atrt_defaults_group_suffix_arg} Cdq \
368+
${site_arg} \
369+
${clusters_arg} \
370+
${verbose_arg} \
371+
$prefix \
372+
my.cnf \
373+
| tee log.txt
374+
375+
atrt_conf_status=${PIPESTATUS[0]}
376+
if [ ${atrt_conf_status} -ne 0 ]; then
377+
echo "Setup configuration failure"
378+
else
379+
args="${atrt_defaults_group_suffix_arg}"
380+
args="$args --report-file=report.txt"
381+
args="$args --testcase-file=$test_dir/$RUN-tests.txt"
382+
args="$args ${baseport_arg}"
383+
args="$args ${site_arg} ${clusters_arg}"
384+
args="$args $prefix"
385+
args="$args ${verbose_arg}"
386+
$atrt $args my.cnf | tee -a log.txt
387+
388+
atrt_test_status=${PIPESTATUS[0]}
389+
if [ $atrt_test_status -ne 0 ]; then
390+
echo "ERROR: $atrt_test_status: $atrt $args my.cnf"
391+
fi
392+
fi
379393

380394
# Make tar-ball
395+
[ -f my.cnf ] && mv my.cnf $res_dir
381396
[ -f log.txt ] && mv log.txt $res_dir
382397
[ -f report.txt ] && mv report.txt $res_dir
383398
[ "`find . -name 'result*'`" ] && mv result* $res_dir

storage/ndb/test/run-test/files.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -257,6 +257,7 @@ setup_files(atrt_config& config, int setup, int sshx)
257257
proc.m_proc.m_cwd.c_str(),
258258
tmp.c_str());
259259
}
260+
return false;
260261
}
261262
else
262263
{

storage/ndb/test/run-test/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -209,6 +209,11 @@ int main(int argc, char **argv) {
209209
goto end;
210210
}
211211

212+
if(!g_config.m_processes.size()) {
213+
g_logger.critical("Error: No processes defined in cluster configuration");
214+
goto end;
215+
}
216+
212217
if (!configure(g_config, g_do_setup)) {
213218
g_logger.critical("Failed to configure");
214219
goto end;

0 commit comments

Comments
 (0)