From 156570aeb2bd567890da31e4efecbe48d7129b8b Mon Sep 17 00:00:00 2001 From: kalyanreddy Date: Wed, 12 Apr 2017 17:48:25 +0530 Subject: Optimizing the code and uploading ftrace logs to artifacts This patch is used to exclude execution of disable_trace.sh as ftrace will be disabled during post-execution of cyclictest through yardstick. Also includes uploading verify logs to artifacts when ftrace is enabled for debugging. Change-Id: I4674f2b9c03274eb2a96b3258a718c9f46419022 Signed-off-by: Gundarapu Kalyan Reddy --- ci/cyclicTestTrigger.sh | 8 ++++---- ci/envs/host-config | 9 ++++++++- ci/test_kvmfornfv.sh | 2 -- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ci/cyclicTestTrigger.sh b/ci/cyclicTestTrigger.sh index 6765569f6..7f606b0b6 100755 --- a/ci/cyclicTestTrigger.sh +++ b/ci/cyclicTestTrigger.sh @@ -41,7 +41,6 @@ function verifyGuestImage { #disabling ftrace and collecting the logs to upload to artifact repository. function ftrace_disable { - sudo ssh root@${HOST_IP} "sh /root/workspace/scripts/disable_trace.sh" sudo ssh root@${HOST_IP} "cd /tmp ; mv trace.txt cyclictest_${env}.txt" mkdir -p $WORKSPACE/build_output/log/kernel_trace scp root@${HOST_IP}:/tmp/cyclictest_${env}.txt $WORKSPACE/build_output/log/kernel_trace/ @@ -189,15 +188,16 @@ function runCyclicTest { sudo docker run -i -v ${volume}:/opt --net=host --name kvmfornfv_${testType}_${testName} \ kvmfornfv:latest /bin/bash -c "cd /opt/scripts && ls; ./cyclictest.sh $testType $testName" cyclictest_output=$? - if [ "$testName" == "memorystress_idle" ];then - copyLogs - fi #Disabling ftrace after completion of executing test cases. if [ ${ftrace_enable} -eq '1' ]; then ftrace_disable fi + if [ "$testName" == "memorystress_idle" ];then + copyLogs + fi + #Verifying the results of cyclictest if [ "$testType" == "verify" ];then result=`grep -o '"errors":[^,]*' ${volume}/yardstick.out | awk -F '"' '{print $4}'` diff --git a/ci/envs/host-config b/ci/envs/host-config index 54d262af4..c656f839b 100755 --- a/ci/envs/host-config +++ b/ci/envs/host-config @@ -64,9 +64,16 @@ function setTestTime { #Tar the log files generated during testcase execution and exit. function test_exit { exitCode=$1 + time_stamp=$(date -u +"%Y-%m-%d_%H-%M-%S") cd $WORKSPACE/build_output/ if [ -d log ];then - tar -czvf log-$(date -u +"%Y-%m-%d_%H-%M-%S").tar.gz log + tar -czvf log-${time_stamp}.tar.gz log + echo "uploading debugging logs to artifacts" + gsutil cp -r log-*.tar.gz gs://artifacts.opnfv.org/kvmfornfv/\ + kvmfornfv_verify_debug_logs_${time_stamp} > \ + $WORKSPACE/build_output/gsutil.log 2>&1 + echo -e "Download the logs from artifacts using below for debugging\n + http://artifacts.opnfv.org/kvmfornfv/kvmfornfv_verify_debug_logs_${time_stamp}" fi exit $exitCode } diff --git a/ci/test_kvmfornfv.sh b/ci/test_kvmfornfv.sh index b1aa97390..5d886dedc 100755 --- a/ci/test_kvmfornfv.sh +++ b/ci/test_kvmfornfv.sh @@ -165,8 +165,6 @@ elif [ ${test_type} == "daily" ];then sed -i '/host-setup1.sh/a\ \- \"enable-trace.sh\"' kvmfornfv_cyclictest_hostenv_guestenv.yaml #Executing cyclictest through yardstick. cyclictest ${env} - #disabling ftrace and collecting the logs to upload to artifact repository. - ftrace_disable sleep 5 done else -- cgit 1.2.3-korg