Merge "[VVP] Support pluggable data sources for preload data"
[vvp/validation-scripts.git] / ice_validator / tests / test_vm_class_has_unique_type.py
index 684c1b4..f264edc 100644 (file)
@@ -35,7 +35,6 @@
 #
 # ============LICENSE_END============================================
 #
 #
 # ============LICENSE_END============================================
 #
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 
 """heat parameters
 #
 
 """heat parameters
@@ -74,8 +73,8 @@ class VmClassValidator(object):
         self.vm_rids = collections.defaultdict(set)
         self.vm_types = collections.defaultdict(set)
         va_config, self.va_count = CinderVolumeAttachmentProcessor.get_config(resources)
         self.vm_rids = collections.defaultdict(set)
         self.vm_types = collections.defaultdict(set)
         va_config, self.va_count = CinderVolumeAttachmentProcessor.get_config(resources)
-        if not va_config:
-            pytest.skip("No Cinder Volume Attachment configurations found")
+        if not va_config:
+            pytest.skip("No Cinder Volume Attachment configurations found")
         for rid, resource in resources.items():
             vm_class = NovaServerProcessor.get_vm_class(resource)
             if vm_class:
         for rid, resource in resources.items():
             vm_class = NovaServerProcessor.get_vm_class(resource)
             if vm_class:
@@ -99,13 +98,15 @@ class VmClassValidator(object):
         for k, v in self.vm_types.items():
             if len(v) > 1:
                 errors.append(
         for k, v in self.vm_types.items():
             if len(v) > 1:
                 errors.append(
-                    "vm-type %s has class conflict %s"
+                    "OS::Nova::Server resources with the same vm_type must have identical configurations. "
+                    "The following OS::Nova::Server resources for vm-type %s do not have identical configurations: %s"
                     % (k, ", ".join(str(list(self.vm_classes[c])) for c in v))
                 )
                 classes = list(v)
                 errors.append(
                     % (k, ", ".join(str(list(self.vm_classes[c])) for c in v))
                 )
                 classes = list(v)
                 errors.append(
-                    "Differences %s"
-                    % ", ".join([str(key_diff(classes[0], c)) for c in classes[1:]])
+                    "The following attributes are detected differences between "
+                    "OS::Nova::Server's with vm_type %s: %s"
+                    % (k, ", ".join([str(key_diff(classes[0], c)) for c in classes[1:]]))
                 )
         for k, v in self.vm_counts.items():
             if len(v) > 1:
                 )
         for k, v in self.vm_counts.items():
             if len(v) > 1:
@@ -135,18 +136,18 @@ def key_diff(d1, d2, prefix=""):
 @validates("R-01455")
 def test_vm_class_has_unique_type(yaml_files):
     """
 @validates("R-01455")
 def test_vm_class_has_unique_type(yaml_files):
     """
-    When a VNFs Heat Orchestration Template creates a Virtual
-    Machine (i.e., OS::Nova::Server), each “class” of VMs MUST be
-    assigned a VNF unique vm-type; where “class” defines VMs that
+    When a VNF's Heat Orchestration Template creates a Virtual
+    Machine (i.e., OS::Nova::Server), each "class" of VMs MUST be
+    assigned a VNF unique vm-type; where "class" defines VMs that
     MUST have the following identical characteristics:
 
     1.  OS::Nova::Server resource property flavor value
     2.  OS::Nova::Server resource property image value
     3.  Cinder Volume attachments
     MUST have the following identical characteristics:
 
     1.  OS::Nova::Server resource property flavor value
     2.  OS::Nova::Server resource property image value
     3.  Cinder Volume attachments
-        Each VM in the “class” MUST have the identical Cinder
+        Each VM in the "class" MUST have the identical Cinder
         Volume configuration
     4.  Network attachments and IP address requirements
         Volume configuration
     4.  Network attachments and IP address requirements
-        Each VM in the “class” MUST have the the identical number of
+        Each VM in the "class" MUST have the the identical number of
         ports connecting to the identical networks and requiring the
         identical IP address configuration
     """
         ports connecting to the identical networks and requiring the
         identical IP address configuration
     """