Bug Fix - 2305: Automated scaling of Vnf is not happening through metrics collected...
[osm/POL.git] / osm_policy_module / tests / integration / test_policy_agent.py
index e96c7e6..54b4e79 100644 (file)
@@ -525,6 +525,8 @@ class PolicyModuleAgentTest(unittest.TestCase):
             vdu_name="cirros_ns-1-cirros_vnfd-VM-1",
             vnf_member_index="1",
             action="scale_out",
+            vnfr=vnfr_record_mocks[0],
+            vnfd=vnfd_record_mock,
         )
         create_alarm.assert_not_called_with(
             metric_name="average_memory_utilization",
@@ -534,6 +536,8 @@ class PolicyModuleAgentTest(unittest.TestCase):
             vdu_name="cirros_ns-1-cirros_vnfd-VM-1",
             vnf_member_index="1",
             action="scale_out",
+            vnfr=vnfr_record_mocks[0],
+            vnfd=vnfd_record_mock,
         )
         create_alarm.assert_any_call(
             metric_name="average_memory_utilization",
@@ -543,6 +547,8 @@ class PolicyModuleAgentTest(unittest.TestCase):
             vdu_name="cirros_ns-2-cirros_vnfd-VM-1",
             vnf_member_index="2",
             action="scale_out",
+            vnfr=vnfr_record_mocks[1],
+            vnfd=vnfd_record_mock,
         )
         create_alarm.assert_not_called_with(
             metric_name="average_memory_utilization",
@@ -552,6 +558,8 @@ class PolicyModuleAgentTest(unittest.TestCase):
             vdu_name="cirros_ns-2-cirros_vnfd-VM-1",
             vnf_member_index="2",
             action="scale_out",
+            vnfr=vnfr_record_mocks[1],
+            vnfd=vnfd_record_mock,
         )
         scaling_record = ScalingGroup.get()
         self.assertEqual(scaling_record.name, "scale_cirros_vnfd-VM")
@@ -593,6 +601,8 @@ class PolicyModuleAgentTest(unittest.TestCase):
             threshold=20.0,
             operation="LT",
             action="{'webhook': ['localhost:9090', 'localhost:9090', 'localhost:9090']}",
+            vnfr=vnfr_record_mocks[0],
+            vnfd=vnfd_record_mock,
         )
         create_alarm.assert_any_call(
             metric_name="average_memory_utilization",
@@ -602,6 +612,8 @@ class PolicyModuleAgentTest(unittest.TestCase):
             threshold=20.0,
             operation="LT",
             action="{'webhook': ['localhost:9090', 'localhost:9090', 'localhost:9090']}",
+            vnfr=vnfr_record_mocks[1],
+            vnfd=vnfd_record_mock,
         )
 
     @patch.object(DbMongo, "db_connect", Mock())