From 42ca6dedd362a81b83e4512846cb1b817162f2df Mon Sep 17 00:00:00 2001 From: George Paraskevopoulos Date: Tue, 6 Sep 2016 12:42:13 +0300 Subject: Reduce logging in the SFC test case JIRA: FUNCTEST-446 Reduce the logs that appear in the Jenkins CI console to make the output of the SFC test case more readable - Redirect tacker installation logs to results folder /home/opnfv/functest/results/odl-sfc.log - Split odl-sfc preparation into a new script - Pipe STDERR in the sfc.py script so that "Added to known hosts" messages do not show in the output Change-Id: Ibf871ade6827d4817f33623b935c5f1d904086bb Signed-off-by: George Paraskevopoulos --- testcases/features/sfc/prepare_odl_sfc.bash | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 testcases/features/sfc/prepare_odl_sfc.bash (limited to 'testcases/features/sfc/prepare_odl_sfc.bash') diff --git a/testcases/features/sfc/prepare_odl_sfc.bash b/testcases/features/sfc/prepare_odl_sfc.bash new file mode 100755 index 000000000..80ed9bd92 --- /dev/null +++ b/testcases/features/sfc/prepare_odl_sfc.bash @@ -0,0 +1,38 @@ +#!/bin/bash + +# +# Author: George Paraskevopoulos (geopar@intracom-telecom.com) +# Manuel Buil (manuel.buil@ericsson.com) +# Prepares the controller and the compute nodes for the odl-sfc testcase +# +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +ODL_SFC_LOG=/home/opnfv/functest/results/odl-sfc.log +ODL_SFC_DIR=${FUNCTEST_REPO_DIR}/testcases/features/sfc + +# Split the output to the log file and redirect STDOUT and STDERR to /dev/null +bash ${ODL_SFC_DIR}/server_presetup_CI.bash |& \ + tee -a ${ODL_SFC_LOG} 1>/dev/null 2>&1 + +# Get return value from PIPESTATUS array (bash specific feature) +ret_val=${PIPESTATUS[0]} +if [ $ret_val != 0 ]; then + echo "The tacker server deployment failed" + exit $ret_val +fi +echo "The tacker server was deployed successfully" + +bash ${ODL_SFC_DIR}/compute_presetup_CI.bash |& \ + tee -a ${ODL_SFC_LOG} 1>/dev/null 2>&1 + +ret_val=${PIPESTATUS[0]} +if [ $ret_val != 0 ]; then + exit $ret_val +fi + +exit 0 -- cgit 1.2.3-korg