aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/sdn
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-02-02 18:25:43 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2017-02-02 18:34:09 +0100
commitcdd7359cc8a28e767de6aed1f6205f41fc055f34 (patch)
tree68d38fd164b7a0261637f6327bd48fa82713bcef /functest/opnfv_tests/sdn
parent93a1ae5974a398adec18ed5580f3d328f646ed02 (diff)
Allow multiple sets of suites in ODL
ODLTests can manage multiple sets of suites passing as run args. It avoids duplicating odl.py according to ODL features installed (e.g. netvirt). Change-Id: Ibb0697ef9441506c3f33627e13a0845cc482e23f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/sdn')
-rwxr-xr-xfunctest/opnfv_tests/sdn/odl/odl.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py
index 339c305e..9502be93 100755
--- a/functest/opnfv_tests/sdn/odl/odl.py
+++ b/functest/opnfv_tests/sdn/odl/odl.py
@@ -54,6 +54,7 @@ class ODLTests(testcase_base.TestcaseBase):
"csit/suites/openstack/neutron")
basic_suite_dir = os.path.join(odl_test_repo,
"csit/suites/integration/basic")
+ default_suites = [basic_suite_dir, neutron_suite_dir]
res_dir = '/home/opnfv/functest/results/odl/'
logger = ft_logger.Logger("opendaylight").getLogger()
@@ -89,8 +90,7 @@ class ODLTests(testcase_base.TestcaseBase):
self.details['description'] = result.suite.name
self.details['tests'] = visitor.get_data()
- def main(self, **kwargs):
- dirs = [self.basic_suite_dir, self.neutron_suite_dir]
+ def main(self, suites=default_suites, **kwargs):
try:
odlusername = kwargs['odlusername']
odlpassword = kwargs['odlpassword']
@@ -117,7 +117,7 @@ class ODLTests(testcase_base.TestcaseBase):
stdout_file = os.path.join(self.res_dir, 'stdout.txt')
output_dir = os.path.join(self.res_dir, 'output.xml')
with open(stdout_file, 'w+') as stdout:
- robot.run(*dirs, variable=variables,
+ robot.run(*suites, variable=variables,
output=output_dir,
log='NONE',
report='NONE',
@@ -140,8 +140,13 @@ class ODLTests(testcase_base.TestcaseBase):
else:
return self.EX_RUN_ERROR
- def run(self):
+ def run(self, **kwargs):
try:
+ suites = self.default_suites
+ try:
+ suites = kwargs["suites"]
+ except KeyError:
+ pass
keystone_url = op_utils.get_endpoint(service_type='identity')
neutron_url = op_utils.get_endpoint(service_type='network')
kwargs = {'keystoneip': urlparse.urlparse(keystone_url).hostname}
@@ -178,7 +183,7 @@ class ODLTests(testcase_base.TestcaseBase):
self.logger.exception("Cannot run ODL testcases.")
return self.EX_RUN_ERROR
- return self.main(**kwargs)
+ return self.main(suites, **kwargs)
class ODLParser():
@@ -228,7 +233,7 @@ if __name__ == '__main__':
parser = ODLParser()
args = parser.parse_args(sys.argv[1:])
try:
- result = odl.main(**args)
+ result = odl.main(ODLTests.default_suites, **args)
if result != testcase_base.TestcaseBase.EX_OK:
sys.exit(result)
if args['pushtodb']: