From 7bd62366a97d4ec8b6f18c13057cb2904431df93 Mon Sep 17 00:00:00 2001 From: h-hayashi Date: Tue, 14 Feb 2017 22:27:29 +0900 Subject: Adding vRouter test codes using TestCasesBase JIRA: FUNCTEST-530 1.setting "nosdn-nofeature" scinario in testcase.yaml. 1.adding process of setting result details for push DB 2.Delete of define "vrouter_data" in config_functest.yaml. 3.modify of vrouter git tag's name "stable". 4.modrify of testcase name "vyos_vrouter" In order to more specific. Change-Id: I0602c01dbf9a5e71bf85943c2b5e40ef51269ffd Signed-off-by: Hideyasu Hayashi --- functest/opnfv_tests/vnf/router/__init__.py | 0 functest/opnfv_tests/vnf/router/vyos_vrouter.py | 33 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 functest/opnfv_tests/vnf/router/__init__.py create mode 100755 functest/opnfv_tests/vnf/router/vyos_vrouter.py (limited to 'functest/opnfv_tests/vnf/router') diff --git a/functest/opnfv_tests/vnf/router/__init__.py b/functest/opnfv_tests/vnf/router/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/functest/opnfv_tests/vnf/router/vyos_vrouter.py b/functest/opnfv_tests/vnf/router/vyos_vrouter.py new file mode 100755 index 00000000..94a3ecfd --- /dev/null +++ b/functest/opnfv_tests/vnf/router/vyos_vrouter.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# +# Copyright 2017 Okinawa Open Laboratory +# +# 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 +import functest.core.feature_base as base +import json +import os + +RESULT_DETAILS_FILE = "test_result.json" + + +class VrouterVnf(base.FeatureBase): + def __init__(self): + super(VrouterVnf, self).__init__(project='vRouter', + case='vyos_vrouter', + repo='dir_repo_vrouter') + self.cmd = 'cd %s && ./run.sh' % self.repo + + def set_result_details(self): + filepath = os.path.join(self.repo, RESULT_DETAILS_FILE) + if os.path.exists(filepath): + f = open(filepath, 'r') + self.details = json.load(f) + f.close() + + def log_results(self): + if self.criteria == 'PASS': + self.set_result_details() + super(VrouterVnf, self).log_results() -- cgit 1.2.3-korg