Configure password for the user in vnf 47/50747/9
authorLinda Wang <wangwulin@huawei.com>
Thu, 18 Jan 2018 03:38:46 +0000 (03:38 +0000)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 20 Jan 2018 13:44:48 +0000 (14:44 +0100)
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>
functest/ci/config_functest.yaml
functest/core/vnf.py
functest/opnfv_tests/vnf/ims/cloudify_ims.py
functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
functest/opnfv_tests/vnf/ims/orchestra_openims.py
tox.ini

index cf6b132..4bb7c44 100644 (file)
@@ -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
index 73aaf44..856e62b 100644 (file)
@@ -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()
index b8a815c..60434ca 100644 (file)
@@ -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,
index 3db53e3..96b526a 100644 (file)
@@ -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()
index d609a0f..572eaa9 100644 (file)
@@ -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()
diff --git a/tox.ini b/tox.ini
index 7d92b17..7062161 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -55,7 +55,7 @@ files =
   functest/ci
   functest/opnfv_tests/vnf
 commands =
-  yamllint {[testenv:yamllint]files}
+  yamllint -s {[testenv:yamllint]files}
 
 [testenv:py35]
 dirs =