Add UT and Funtion for infra SRIOV 67/67967/1
authorHuang Haibin <haibin.huang@intel.com>
Thu, 20 Sep 2018 02:39:57 +0000 (10:39 +0800)
committerHuang Haibin <haibin.huang@intel.com>
Thu, 20 Sep 2018 02:39:57 +0000 (10:39 +0800)
Change-Id: I6ce0f4e8a9a6b7984deeb28ae9ff50df3995e60c
Issue-ID: MULTICLOUD-250
Signed-off-by: Huang Haibin <haibin.huang@intel.com>
pike/pike/resource/tests/tests_infra_workload.py
pike/pike/resource/views/infra_workload.py

index 48c29d1..e473c84 100644 (file)
@@ -51,6 +51,16 @@ MOCK_HEAT_CREATE_BODY1 =   {
                              "attribute_value":"m1.hpa.medium"
                          }
                      ]
+                 },
+                 {
+                     "type":"sriovNetNetwork_directives",
+                     "attributes":[
+                         {
+                             "attribute_name":"physnetwork_label",
+                             "attribute_value":"physnet1"
+                         }
+                     ]
+
                  }
                  ]
              }
index 3e144e7..4d0b671 100644 (file)
@@ -55,8 +55,7 @@ class InfraWorkload(APIView):
                 for directive in oof_directive.get("directives", []):
                     if directive["type"] == "vnfc":
                         for directive2 in directive.get("directives", []):
-                            #if directive2["type"] in ["flavor_directives", "sriovNICNetwork_directives"]:
-                            if directive2["type"] == "flavor_directives":
+                            if directive2["type"] in ["flavor_directives", "sriovNICNetwork_directives"]:
                                 for attr in directive2.get("attributes", []):
                                     label_name = attr["attribute_name"]
                                     label_value = attr["attribute_value"]