summaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
authorCarlos Goncalves <carlos.goncalves@neclab.eu>2016-09-01 17:40:33 +0200
committerCarlos Goncalves <carlos.goncalves@neclab.eu>2016-09-05 14:54:59 +0200
commita84bbc24ee6a7c9965708d3ddc415804c2736f98 (patch)
treed6be154c6591467dffc9540904108e616c0f9068 /testcases
parente3d6f897b008407d47a91c9f1b5eb5961924bd38 (diff)
Print all the Copper test output to a log file
To keep the jenkins console clean and readable, dump all the output that the Copper test case generates to a log file and push it to artifact repository at the end. Change-Id: If4812c7e92b4d050757ca07333f7c353a0220056 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com> Signed-off-by: Carlos Goncalves <carlos.goncalves@neclab.eu> (cherry picked from commit 7442f6fb3ec962481d45a8ee0d12ad96242d9c0e)
Diffstat (limited to 'testcases')
-rwxr-xr-xtestcases/features/copper.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/testcases/features/copper.py b/testcases/features/copper.py
index 73def7db2..9be909427 100755
--- a/testcases/features/copper.py
+++ b/testcases/features/copper.py
@@ -14,23 +14,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+import argparse
import sys
import time
-import argparse
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
+
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--report",
help="Create json result file",
action="store_true")
args = parser.parse_args()
-functest_yaml = functest_utils.get_functest_yaml()
-
-dirs = functest_yaml.get('general').get('directories')
-COPPER_REPO = dirs.get('dir_repo_copper')
+COPPER_REPO = functest_utils.get_parameter_from_yaml(
+ 'general.directories.dir_repo_copper')
+RESULTS_DIR = functest_utils.get_parameter_from_yaml(
+ 'general.directories.dir_results')
logger = ft_logger.Logger("copper").getLogger()
@@ -40,7 +41,10 @@ def main():
start_time = time.time()
- ret_val = functest_utils.execute_command(cmd, logger, exit_on_error=False)
+ log_file = RESULTS_DIR + "/copper.log"
+ ret_val = functest_utils.execute_command(cmd,
+ exit_on_error=False,
+ output_file=log_file)
stop_time = time.time()
duration = round(stop_time - start_time, 1)