summaryrefslogtreecommitdiffstats
path: root/snaps/test_runner.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-03-22 15:56:54 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-04-12 14:49:56 -0600
commitf340c1e7b021fa3a67c295bcec7f09cddfb687cc (patch)
tree943ff05f36a4377174a4cf244655271f3e468b3f /snaps/test_runner.py
parent4762240029f3ab7393a353f094a746ebbb70f288 (diff)
Refactored SNAPS tests to take in the actual OSCreds object.
The code previously had individual parameters for different aspects of the credentials. This change not only makes the method calls easier, but it also helps the logs from becoming too verbose as each test case was instantiating its own OSCreds instance. JIRA: SNAPS-23 Change-Id: I8860e7329b9ec59d78e5977af74f4d3073496f24 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/test_runner.py')
-rw-r--r--snaps/test_runner.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/snaps/test_runner.py b/snaps/test_runner.py
index a8f2313..00b1b25 100644
--- a/snaps/test_runner.py
+++ b/snaps/test_runner.py
@@ -19,6 +19,7 @@ import os
import unittest
from snaps import test_suite_builder
+from snaps.openstack.tests import openstack_tests
__author__ = 'spisarski'
@@ -51,26 +52,28 @@ def __create_test_suite(source_filename, ext_net_name, proxy_settings, ssh_proxy
"""
suite = unittest.TestSuite()
+ os_creds = openstack_tests.get_credentials(os_env_file=source_filename, proxy_settings_str=proxy_settings,
+ ssh_proxy_cmd=ssh_proxy_cmd)
+
# Tests that do not require a remote connection to an OpenStack cloud
if run_unit_tests:
test_suite_builder.add_unit_tests(suite)
# Basic connection tests
if run_connection_tests:
- test_suite_builder.add_openstack_client_tests(suite, source_filename, ext_net_name, use_keystone=use_keystone,
- http_proxy_str=proxy_settings, log_level=log_level)
+ test_suite_builder.add_openstack_client_tests(
+ suite=suite, os_creds=os_creds, ext_net_name=ext_net_name, use_keystone=use_keystone, log_level=log_level)
# Tests the OpenStack API calls
if run_api_tests:
- test_suite_builder.add_openstack_api_tests(suite, source_filename, ext_net_name, use_keystone=use_keystone,
- http_proxy_str=proxy_settings, log_level=log_level)
+ test_suite_builder.add_openstack_api_tests(
+ suite=suite, os_creds=os_creds, ext_net_name=ext_net_name, use_keystone=use_keystone, log_level=log_level)
# Long running integration type tests
if run_integration_tests:
- test_suite_builder.add_openstack_integration_tests(suite, source_filename, ext_net_name, use_keystone=use_keystone,
- proxy_settings=proxy_settings, ssh_proxy_cmd=ssh_proxy_cmd,
- flavor_metadata=flavor_metadata,
- use_floating_ips=use_floating_ips, log_level=log_level)
+ test_suite_builder.add_openstack_integration_tests(
+ suite=suite, os_creds=os_creds, ext_net_name=ext_net_name, use_keystone=use_keystone,
+ flavor_metadata=flavor_metadata, use_floating_ips=use_floating_ips, log_level=log_level)
return suite