diff options
author | Linda Wang <wangwulin@huawei.com> | 2018-01-18 03:38:46 +0000 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-01-20 14:44:48 +0100 |
commit | 45fdfedc5b5573926c53264ff5eb3e48a43345d9 (patch) | |
tree | b019258489c75e48e86046e6d30c2d49297b7bc0 | |
parent | d181f61205869adef1b8763feb531cc3df52669f (diff) |
Configure password for the user in vnf
For some SUTs, the password for creating user is not allowed to
be the same as user name, and some even is required to contain
at least 8 characters and three types of characters for security.
It also turns yamllint warnings into errors and fixes the remaining
warnings.
Change-Id: Icf25a7b9ff1c8cee55899198f1e519c9209877ff
Signed-off-by: Linda Wang <wangwulin@huawei.com>
-rw-r--r-- | functest/ci/config_functest.yaml | 8 | ||||
-rw-r--r-- | functest/core/vnf.py | 3 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.py | 6 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py | 6 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/orchestra_openims.py | 6 | ||||
-rw-r--r-- | tox.ini | 2 |
6 files changed, 16 insertions, 15 deletions
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml index cf6b1328..4bb7c441 100644 --- a/functest/ci/config_functest.yaml +++ b/functest/ci/config_functest.yaml @@ -57,10 +57,10 @@ snaps: centos: disk_file: /home/opnfv/functest/images/CentOS-7-x86_64-GenericCloud.qcow2 - # netconf_override: - # network_type: vlan - # physical_network: physnet2 - # segmentation_id: 2366 +# netconf_override: +# network_type: vlan +# physical_network: physnet2 +# segmentation_id: 2366 # All of these values are optional and will override the values retrieved # by the RC file diff --git a/functest/core/vnf.py b/functest/core/vnf.py index 73aaf446..856e62b5 100644 --- a/functest/core/vnf.py +++ b/functest/core/vnf.py @@ -11,6 +11,7 @@ import logging import time +import uuid import functest.core.testcase as base from functest.utils.constants import CONST @@ -122,7 +123,7 @@ class VnfOnBoarding(base.TestCase): snaps_creds, UserConfig( name=self.tenant_name, - password=self.tenant_name, + password=str(uuid.uuid4()), roles={'admin': self.tenant_name})) user_creator.create() diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index b8a815c2..60434ca9 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -228,9 +228,9 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): self.snaps_creds, 'identity') self.__logger.info("Set creds for cloudify manager") - cfy_creds = dict(keystone_username=self.tenant_name, - keystone_password=self.tenant_name, - keystone_tenant_name=self.tenant_name, + cfy_creds = dict(keystone_username=self.snaps_creds.username, + keystone_password=self.snaps_creds.password, + keystone_tenant_name=self.snaps_creds.project_name, keystone_url=public_auth_url) cfy_client = CloudifyClient(host=manager_creator.get_floating_ip().ip, diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py index 3db53e35..96b526a2 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py @@ -211,9 +211,9 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): self.snaps_creds, 'identity') self.creds = { - "tenant": self.tenant_name, - "username": self.tenant_name, - "password": self.tenant_name, + "tenant": self.snaps_creds.project_name, + "username": self.snaps_creds.username, + "password": self.snaps_creds.password, "auth_url": public_auth_url } self.prepare_images() diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py index d609a0fb..572eaa9a 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_openims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_openims.py @@ -206,9 +206,9 @@ class OpenImsVnf(vnf.VnfOnBoarding): self.logger.info("Additional pre-configuration steps") self.creds = { - "tenant": self.tenant_name, - "username": self.tenant_name, - "password": self.tenant_name, + "tenant": self.snaps_creds.project_name, + "username": self.snaps_creds.username, + "password": self.snaps_creds.password, "auth_url": public_auth_url } self.prepare_images() @@ -55,7 +55,7 @@ files = functest/ci functest/opnfv_tests/vnf commands = - yamllint {[testenv:yamllint]files} + yamllint -s {[testenv:yamllint]files} [testenv:py35] dirs = |