import sys
import time
import uuid
-import json
from argparse import ArgumentParser
__author__ = "Pablo Montes, Alfonso Tierno"
with self.assertRaises(Exception) as context:
test_config["vim_conn"].delete_network(Non_exist_id)
- self.assertEqual((context.exception).http_code, 400)
+ self.assertEqual((context.exception).http_code, 404)
class test_vimconn_get_flavor(test_base):
tenant_name = args.tenant_name
test_config['tenant'] = tenant_name
- config_params = json.loads(args.config_param)
+ config_params = yaml.load(args.config_param)
org_name = config_params.get('orgname')
org_user = config_params.get('user')
org_passwd = config_params.get('passwd')
import vimconn_aws as vim
elif args.vimtype == "openstack":
import vimconn_openstack as vim
+
+ test_config["test_directory"] = os.path.dirname(__file__) + "/RO_tests"
+
+ tenant_name = args.tenant_name
+ test_config['tenant'] = tenant_name
+ config_params = yaml.load(args.config_param)
+ os_user = config_params.get('user')
+ os_passwd = config_params.get('passwd')
+ vim_url = args.endpoint_url
+ test_config['image_path'] = args.image_path
+ test_config['image_name'] = args.image_name
+
+ # openstack connector obj
+ vim_persistent_info = {}
+ test_config['vim_conn'] = vim.vimconnector(
+ uuid="test-uuid-1", name="VIO-openstack",
+ tenant_id=None, tenant_name=tenant_name,
+ url=vim_url, url_admin=None,
+ user=os_user, passwd=os_passwd,
+ config=config_params, persistent_info=vim_persistent_info
+ )
+ test_config['vim_conn'].debug = "true"
+
elif args.vimtype == "openvim":
import vimconn_openvim as vim
else:
if args.list_tests:
tests_names = []
for cls in clsmembers:
- if cls[0].startswith('test_vimconnector'):
+ if cls[0].startswith('test_vimconn'):
tests_names.append(cls[0])
msg = "The 'vim' set tests are:\n\t" + ', '.join(sorted(tests_names))
# include all tests
for cls in clsmembers:
# We exclude 'test_VIM_tenant_operations' unless it is specifically requested by the user
- if cls[0].startswith('test_vimconnector'):
+ if cls[0].startswith('test_vimconn'):
code_based_tests.append(cls[1])
logger.debug("tests to be executed: {}".format(code_based_tests))