diff --git a/initial/base_config/script/prepare.py b/initial/base_config/script/prepare.py index d555c63be1cbf9909d833e55577bb789cfde4b83..2276362802b08b436e3bdce82196479fd4ca8c02 100644 --- a/initial/base_config/script/prepare.py +++ b/initial/base_config/script/prepare.py @@ -16,7 +16,10 @@ if [ $# -lt 1 ];then exit 1 fi -tone_install=$1 +# Note that the default location to run tests is "/tmp/tone". The loaction will +# be changed if variable TONE_PATH is set by user (e.g. TONE_PATH="/opt/tone"), +# which is pretty helpful if dir "/tmp" doesn't have enough space. +tone_install=${TONE_PATH:-"$1"} provider=$2 logfile=/tmp/prepare_tone.log tone_branch=${TONE_DEBUG_BRANCH:-master} diff --git a/initial/base_config/script/prepare_debian.py b/initial/base_config/script/prepare_debian.py index 7929257d85af342ef432122baa02357d746de380..1f5a22bcf362977d19b08f3177016ed21030e439 100644 --- a/initial/base_config/script/prepare_debian.py +++ b/initial/base_config/script/prepare_debian.py @@ -16,7 +16,10 @@ if [ $# -lt 1 ];then exit 1 fi -tone_install=$1 +# Note that the default location to run tests is "/tmp/tone". The loaction will +# be changed if variable TONE_PATH is set by user (e.g. TONE_PATH="/opt/tone"), +# which is pretty helpful if dir "/tmp" doesn't have enough space. +tone_install=${TONE_PATH:-"$1"} provider=$2 logfile=/tmp/prepare_tone.log tone_branch=${TONE_DEBUG_BRANCH:-master} diff --git a/initial/base_config/script/run_test.py b/initial/base_config/script/run_test.py index 65a5571e9b8c054014ace9dadf14b064d21d1677..324d4a4ee8605afaf37af50e506199a4806b7c41 100644 --- a/initial/base_config/script/run_test.py +++ b/initial/base_config/script/run_test.py @@ -11,7 +11,10 @@ RUN_TEST = """#!/bin/bash # 4.上传测试结果及日志 #-------------------------------------------- -TONE_PATH=$1 +# Note that the default location to run tests is "/tmp/tone". The loaction will +# be changed if variable TONE_PATH is set by user (e.g. TONE_PATH="/opt/tone"), +# which is pretty helpful if dir "/tmp" doesn't have enough space. +TONE_PATH=${TONE_PATH:-"$1"} TONE_BIN=/usr/local/bin/tone TEST_SUITE=$2 TEST_CONF=$3 @@ -117,7 +120,7 @@ function upload_dir(){{ lftp -u ${{TONE_STORAGE_USER}},${{TONE_STORAGE_PASSWORD}} -e "${{SFTP_PARAMS}}" sftp://${{TONE_STORAGE_HOST}}:${{TONE_STORAGE_SFTP_PORT}} >> $ALL_LOG 2>&1 <> "$LOG" echo "${{file:$TONE_RESULT_PATH_LEN}}" diff --git a/initial/base_config/script/run_test_debian.py b/initial/base_config/script/run_test_debian.py index d4656db242a2fe8e3d620d97d85e0cb5bac99ab9..f5b3fc992b0d546a9ffc451dc4077dc51477422f 100644 --- a/initial/base_config/script/run_test_debian.py +++ b/initial/base_config/script/run_test_debian.py @@ -20,7 +20,10 @@ TONE_STORAGE_USER={tone_storage_user} TONE_STORAGE_PASSWORD={tone_storage_password} TONE_STORAGE_BUCKET=${{7:-results}} -TONE_PATH=$1 +# Note that the default location to run tests is "/tmp/tone". The loaction will +# be changed if variable TONE_PATH is set by user (e.g. TONE_PATH="/opt/tone"), +# which is pretty helpful if dir "/tmp" doesn't have enough space. +TONE_PATH=${TONE_PATH:-"$1"} TONE_BIN=/usr/local/bin/tone TEST_SUITE=$2 TEST_CONF=$3 @@ -113,13 +116,13 @@ upload_file(){{ fi mkdir -p $file_path - + expect << EOF set timeout 30 spawn sftp -P $TONE_STORAGE_SFTP_PORT $TONE_STORAGE_USER@$TONE_STORAGE_HOST expect "password" {{ send "$TONE_STORAGE_PASSWORD\\n" }} - + expect "tp>" {{ send "cd $TONE_STORAGE_BUCKET\\n" }} expect "tp>" {{ send "cd $file_path\\n" }} expect "tp>" {{ send "put $file\\n" }} @@ -138,14 +141,14 @@ upload_dir(){{ exit 2 fi - mkdir -p $TONE_JOB_ID/$OSS_RESULT_FOLDER - + mkdir -p $TONE_JOB_ID/$OSS_RESULT_FOLDER + expect << EOF set timeout 30 spawn sftp -P $TONE_STORAGE_SFTP_PORT $TONE_STORAGE_USER@$TONE_STORAGE_HOST expect "password" {{ send "$TONE_STORAGE_PASSWORD\\n" }} - + expect "tp>" {{ send "cd $TONE_STORAGE_BUCKET\\n" }} expect "tp>" {{ send "put -R $TONE_JOB_ID\\n" }} expect "tp>" {{ send "cd $TONE_JOB_ID/$OSS_RESULT_FOLDER\\n" }} @@ -250,4 +253,4 @@ echo $file_result_path >> $LOG echo $file_result_path list_file $TONE_RESULT_PATH -""" \ No newline at end of file +""" diff --git a/initial/base_config/script/upload.py b/initial/base_config/script/upload.py index aed76371313752d2935f5caf74b7f36340501957..15c62ac438e595791a33866eb8163604ece10b63 100644 --- a/initial/base_config/script/upload.py +++ b/initial/base_config/script/upload.py @@ -6,7 +6,10 @@ UPLOAD = """#!/bin/bash # 该脚本用来当RUN_TEST步骤失败或者中止后上传执行日志 #-------------------------------------------- -TONE_PATH=$1 +# Note that the default location to run tests is "/tmp/tone". The loaction will +# be changed if variable TONE_PATH is set by user (e.g. TONE_PATH="/opt/tone"), +# which is pretty helpful if dir "/tmp" doesn't have enough space. +TONE_PATH=${TONE_PATH:-"$1"} TEST_SUITE=$2 TEST_CONF=$3 OSS_RESULT_FOLDER=$4