aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/vnf')
-rw-r--r--functest/opnfv_tests/vnf/__init__.py0
-rw-r--r--functest/opnfv_tests/vnf/ims/clearwater.py (renamed from functest/opnfv_tests/vnf/vIMS/clearwater.py)2
-rwxr-xr-xfunctest/opnfv_tests/vnf/ims/create_venv.sh (renamed from functest/opnfv_tests/vnf/vIMS/create_venv.sh)0
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestrator.py (renamed from functest/opnfv_tests/vnf/vIMS/orchestrator.py)2
-rw-r--r--functest/opnfv_tests/vnf/ims/requirements.pip (renamed from functest/opnfv_tests/vnf/vIMS/requirements.pip)0
-rwxr-xr-xfunctest/opnfv_tests/vnf/ims/vims.py (renamed from functest/opnfv_tests/vnf/vIMS/vIMS.py)10
-rw-r--r--functest/opnfv_tests/vnf/rnc/__init__.py0
-rw-r--r--functest/opnfv_tests/vnf/rnc/parser.py79
-rwxr-xr-xfunctest/opnfv_tests/vnf/vRNC/parser.py70
9 files changed, 86 insertions, 77 deletions
diff --git a/functest/opnfv_tests/vnf/__init__.py b/functest/opnfv_tests/vnf/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functest/opnfv_tests/vnf/__init__.py
diff --git a/functest/opnfv_tests/vnf/vIMS/clearwater.py b/functest/opnfv_tests/vnf/ims/clearwater.py
index 7236f4fb..eb0abacd 100644
--- a/functest/opnfv_tests/vnf/vIMS/clearwater.py
+++ b/functest/opnfv_tests/vnf/ims/clearwater.py
@@ -12,7 +12,7 @@
########################################################################
-class clearwater:
+class Clearwater:
def __init__(self, inputs={}, orchestrator=None, logger=None):
self.config = inputs
diff --git a/functest/opnfv_tests/vnf/vIMS/create_venv.sh b/functest/opnfv_tests/vnf/ims/create_venv.sh
index 575fd177..575fd177 100755
--- a/functest/opnfv_tests/vnf/vIMS/create_venv.sh
+++ b/functest/opnfv_tests/vnf/ims/create_venv.sh
diff --git a/functest/opnfv_tests/vnf/vIMS/orchestrator.py b/functest/opnfv_tests/vnf/ims/orchestrator.py
index 61157a4f..5f84df00 100644
--- a/functest/opnfv_tests/vnf/vIMS/orchestrator.py
+++ b/functest/opnfv_tests/vnf/ims/orchestrator.py
@@ -21,7 +21,7 @@ from git import Repo
import functest.utils.functest_logger as ft_logger
-class orchestrator:
+class Orchestrator:
def __init__(self, testcase_dir, inputs={}):
self.testcase_dir = testcase_dir
diff --git a/functest/opnfv_tests/vnf/vIMS/requirements.pip b/functest/opnfv_tests/vnf/ims/requirements.pip
index ab26f6e0..ab26f6e0 100644
--- a/functest/opnfv_tests/vnf/vIMS/requirements.pip
+++ b/functest/opnfv_tests/vnf/ims/requirements.pip
diff --git a/functest/opnfv_tests/vnf/vIMS/vIMS.py b/functest/opnfv_tests/vnf/ims/vims.py
index 4cc8ce30..fe888b69 100755
--- a/functest/opnfv_tests/vnf/vIMS/vIMS.py
+++ b/functest/opnfv_tests/vnf/ims/vims.py
@@ -27,8 +27,8 @@ from neutronclient.v2_0 import client as ntclient
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
-from clearwater import clearwater
-from orchestrator import orchestrator
+from clearwater import Clearwater
+from orchestrator import Orchestrator
import functest.utils.functest_constants as ft_constants
pp = pprint.PrettyPrinter(indent=4)
@@ -49,7 +49,7 @@ logger = ft_logger.Logger("vIMS").getLogger()
# Cloudify parameters
-VIMS_DIR = os.path.join(ft_constants.FUNCTEST_TEST_DIR, 'vnf/vIMS/')
+VIMS_DIR = os.path.join(ft_constants.FUNCTEST_TEST_DIR, 'vnf/ims/')
VIMS_DATA_DIR = ft_constants.VIMS_DATA_DIR
VIMS_TEST_DIR = ft_constants.VIMS_TEST_DIR
VIMS_TENANT_NAME = ft_constants.VIMS_TENANT_NAME
@@ -328,7 +328,7 @@ def main():
public_auth_url = keystone.service_catalog.url_for(
service_type='identity', endpoint_type='publicURL')
- cfy = orchestrator(VIMS_DATA_DIR, CFY_INPUTS)
+ cfy = Orchestrator(VIMS_DATA_DIR, CFY_INPUTS)
cfy.set_credentials(username=ks_creds['username'], password=ks_creds[
'password'], tenant_name=ks_creds['tenant_name'],
@@ -413,7 +413,7 @@ def main():
# ############### CLEARWATER INITIALISATION ################
- cw = clearwater(CW_INPUTS, cfy, logger)
+ cw = Clearwater(CW_INPUTS, cfy, logger)
logger.info("Collect flavor id for all clearwater vm")
nova = nvclient.Client("2", **nv_creds)
diff --git a/functest/opnfv_tests/vnf/rnc/__init__.py b/functest/opnfv_tests/vnf/rnc/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functest/opnfv_tests/vnf/rnc/__init__.py
diff --git a/functest/opnfv_tests/vnf/rnc/parser.py b/functest/opnfv_tests/vnf/rnc/parser.py
new file mode 100644
index 00000000..f653220a
--- /dev/null
+++ b/functest/opnfv_tests/vnf/rnc/parser.py
@@ -0,0 +1,79 @@
+#!/usr/bin/python
+#
+# Copyright 2016 ZTE Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import os
+import sys
+import time
+
+import argparse
+
+import functest.core.TestCasesBase as base
+import functest.utils.functest_constants as ft_constants
+import functest.utils.functest_logger as ft_logger
+import functest.utils.functest_utils as ft_utils
+
+
+class Parser(base.TestCasesBase):
+
+ def __init__(self):
+ super(Parser, self).__init__()
+ self.project_name = "parser"
+ self.case_name = "parser-basics"
+ self.logger = ft_logger.Logger("parser").getLogger()
+ self.log_file = os.path.join(
+ ft_constants.FUNCTEST_RESULTS_DIR, "parser.log")
+
+ def run(self, **kwargs):
+ cmd = 'cd %s/tests && ./functest_run.sh' % ft_constants.PARSER_REPO_DIR
+
+ self.start_time = time.time()
+ ret = ft_utils.execute_command(cmd,
+ info=True,
+ output_file=self.log_file)
+ self.stop_time = time.time()
+
+ self.criteria, details = ft_utils.check_test_result(self.project_name,
+ ret,
+ self.start_time,
+ self.stop_time)
+
+ ft_utils.logger_test_results(self.project_name,
+ self.case_name,
+ self.criteria,
+ details)
+
+ return ret
+
+ @staticmethod
+ def get_conf(parameter):
+ return ft_utils.get_functest_config(parameter)
+
+
+if __name__ == '__main__':
+ args_parser = argparse.ArgumentParser()
+ args_parser.add_argument("-r", "--report",
+ help="Create json result file",
+ action="store_true")
+ args = vars(args_parser.parse_args())
+ parser = Parser()
+ try:
+ result = parser.run(**args)
+ if result != base.TestCasesBase.EX_OK:
+ sys.exit(result)
+ if args['report']:
+ sys.exit(parser.push_to_db())
+ except Exception:
+ sys.exit(base.TestCasesBase.EX_RUN_ERROR)
diff --git a/functest/opnfv_tests/vnf/vRNC/parser.py b/functest/opnfv_tests/vnf/vRNC/parser.py
deleted file mode 100755
index 33d4d50c..00000000
--- a/functest/opnfv_tests/vnf/vRNC/parser.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2016 ZTE Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-import argparse
-import time
-
-import functest.utils.functest_logger as ft_logger
-import functest.utils.functest_utils as functest_utils
-import functest.utils.functest_constants as ft_constants
-
-parser = argparse.ArgumentParser()
-parser.add_argument("-r", "--report",
- help="Create json result file",
- action="store_true")
-args = parser.parse_args()
-
-PARSER_REPO = ft_constants.PARSER_REPO
-RESULTS_DIR = ft_constants.FUNCTEST_RESULTS_DIR
-
-logger = ft_logger.Logger("parser").getLogger()
-
-
-def main():
- project = 'parser'
- case_name = 'parser-basics'
- cmd = 'cd %s/tests && ./functest_run.sh' % PARSER_REPO
-
- start_time = time.time()
- log_file = RESULTS_DIR + "/parser.log"
- ret = functest_utils.execute_command(cmd,
- info=True,
- output_file=log_file)
- stop_time = time.time()
-
- status, details = functest_utils.check_test_result(project,
- ret,
- start_time,
- stop_time)
-
- functest_utils.logger_test_results(project,
- case_name,
- status,
- details)
-
- if args.report:
- logger.debug("Report Parser Results to DB......")
- functest_utils.push_results_to_db(project,
- case_name,
- start_time,
- stop_time,
- status,
- details)
- exit(ret)
-
-
-if __name__ == '__main__':
- main()