diff options
author | 2017-12-14 17:37:33 +0000 | |
---|---|---|
committer | 2017-12-14 17:37:40 +0000 | |
commit | fc0d8c601ce627d5f7b8c5e3eef73bd01c6db7d4 (patch) | |
tree | c16e766291612d03494e4c2a4563bddd834ada89 /functest/opnfv_tests/vnf/router/utilvnf.py | |
parent | 7d834311d2828437bc5350efb0792062b59ace56 (diff) |
[vyos_vrouter] Support https endpoints
JIRA: FUNCTEST-881
vyos_vrouter did not support https endpoints [1].
I fixed the following two points.
1. Modifying blueprint of Cloudify.
2. Changing nova client of utilvnf module.
Point 1
I added command of support https endpoint to blueprint of vyos_vrouter.
The Blueprint of vyos_vrouter is on our github repository [2].
I updated our repository.
Point 2
I changed nova client of utilvnf module.
Utilvnf module is utility module of vyos_vrouter.
Nova client of utilvnf module did not support https endpoints.
So, I changed to use nova client of snaps.
After fixed the source code, I confirmed the vyos_vrouter was succeeded in the following two environments.
1. Our labs (Instoller:fuel, environment of https endpoints)
2. Orange POD (Instoller:compass, environment of http endpoints)
[1] https://jira.opnfv.org/browse/FUNCTEST-881
[2] https://github.com/oolorg/opnfv-vnf-vyos-blueprint/blob/master/function-test-openstack-blueprint.yaml
Change-Id: I468df0f2486a34bc558ad161eb7de44264549006
Signed-off-by: ShuyaNakama <shuya.nakama@okinawaopenlabs.org>
Diffstat (limited to 'functest/opnfv_tests/vnf/router/utilvnf.py')
-rw-r--r-- | functest/opnfv_tests/vnf/router/utilvnf.py | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/functest/opnfv_tests/vnf/router/utilvnf.py b/functest/opnfv_tests/vnf/router/utilvnf.py index c31d6777..9d196836 100644 --- a/functest/opnfv_tests/vnf/router/utilvnf.py +++ b/functest/opnfv_tests/vnf/router/utilvnf.py @@ -18,10 +18,9 @@ import yaml from functest.utils.constants import CONST from git import Repo -from novaclient import client as novaclient -from keystoneauth1.identity import v3 -from keystoneauth1 import session from requests.auth import HTTPBasicAuth +from snaps.openstack.utils import nova_utils + RESULT_SPRIT_INDEX = { "transfer": 8, @@ -53,10 +52,7 @@ class Utilvnf(object): logger = logging.getLogger(__name__) def __init__(self): - self.username = "" - self.password = "" - self.auth_url = "" - self.tenant_name = "" + self.snaps_creds = "" data_dir = data_dir = CONST.__getattribute__('dir_router_data') @@ -114,31 +110,12 @@ class Utilvnf(object): self.logger.debug("removed %s" % self.test_result_json_file) def get_nova_client(self): - creds = self.get_nova_credentials() - auth = v3.Password(auth_url=creds['auth_url'], - username=creds['username'], - password=creds['password'], - project_name=creds['tenant_name'], - user_domain_id='default', - project_domain_id='default') - sess = session.Session(auth=auth) - nova_client = novaclient.Client(NOVA_CLIENT_API_VERSION, session=sess) + nova_client = nova_utils.nova_client(self.snaps_creds) return nova_client - def set_credentials(self, username, password, auth_url, tenant_name): - self.username = username - self.password = password - self.auth_url = auth_url - self.tenant_name = tenant_name - - def get_nova_credentials(self): - creds = {} - creds['username'] = self.username - creds['password'] = self.password - creds['auth_url'] = self.auth_url - creds['tenant_name'] = self.tenant_name - return creds + def set_credentials(self, snaps_creds): + self.snaps_creds = snaps_creds def get_address(self, server_name, network_name): nova_client = self.get_nova_client() |