test remote instead run remote in regression test

Summary:
avoid exit when $? != 0
Closes https://github.com/facebook/rocksdb/pull/2076

Differential Revision: D4815655

Pulled By: lightmark

fbshipit-source-id: 829299e
This commit is contained in:
Aaron Gao 2017-03-31 18:40:45 -07:00 committed by Facebook Github Bot
parent c81a805fe6
commit bd7d13835e

View File

@ -126,9 +126,9 @@ function main {
if [ $TEST_MODE -le 1 ]; then
tmp=$DB_PATH
DB_PATH=$ORIGIN_PATH
run_remote "test -d $DB_PATH"
if [[ $? -ne 0 ]] || [[ $(run_remote 'echo $(( $(date +"%s") - $(stat -c "%Y" '"$a"') ))') -gt "604800" ]]; then
rm -rf "$DB_PATH"
test_remote "test -d $DB_PATH"
if [[ $? -ne 0 ]] || [[ $(run_remote 'echo $(( $(date +"%s") - $(stat -c "%Y" '"$DB_PATH"') ))') -gt "604800" ]]; then
run_remote "rm -rf $DB_PATH"
echo "Building DB..."
run_db_bench "fillseqdeterministic" $NUM_KEYS 1 0
fi
@ -355,14 +355,17 @@ function build_db_bench_and_ldb {
}
function run_remote {
if ! [ -z "$REMOTE_USER_AT_HOST" ]; then
cmd="$SSH $REMOTE_USER_AT_HOST $1"
else
cmd="$1"
fi
test_remote "$1"
exit_on_error $? "$1"
}
function test_remote {
if ! [ -z "$REMOTE_USER_AT_HOST" ]; then
cmd="$SSH $REMOTE_USER_AT_HOST $1"
else
cmd="$1"
fi
eval "$cmd"
exit_on_error $? "$cmd"
}
function run_local {