Exemplo n.º 1
0
 def test_report_same_values_from_same_agent_only_forced(self):
     assert_report_item_list_equal(
         primitive._validate_unique_instance_attributes(
             self._fixture_metadata(),
             {
                 "addr": "127.0.0.1",
                 "port": "53",
                 "unique": "value1"
             },
             self.cib,
             force=True,
         ),
         [
             fixture.warn(
                 reports.codes.
                 RESOURCE_INSTANCE_ATTR_GROUP_VALUE_NOT_UNIQUE,
                 group_name="connection",
                 instance_attrs_map={
                     "addr": "127.0.0.1",
                     "port": "53"
                 },
                 agent_name="ocf:pacemaker:pcstest",
                 resource_id_list=["R1", "R3"],
             ),
             fixture.warn(
                 reports.codes.RESOURCE_INSTANCE_ATTR_VALUE_NOT_UNIQUE,
                 instance_attr_name="unique",
                 instance_attr_value="value1",
                 agent_name="ocf:pacemaker:pcstest",
                 resource_id_list=["R1"],
             ),
         ],
     )
Exemplo n.º 2
0
 def test_not_defined_values(self):
     assert_report_item_list_equal(
         primitive._validate_unique_instance_attributes(
             self._fixture_metadata(),
             {"addr": "127.0.0.2"},
             self.cib,
         ),
         [],
     )
Exemplo n.º 3
0
 def test_ignore_own_values_on_update(self):
     assert_report_item_list_equal(
         primitive._validate_unique_instance_attributes(
             self._fixture_metadata(),
             {"unique": "value1"},
             self.cib,
             resource_id="R1",
         ),
         [],
     )
Exemplo n.º 4
0
 def test_no_report_when_not_all_values_in_group_are_same(self):
     assert_report_item_list_equal(
         primitive._validate_unique_instance_attributes(
             self._fixture_metadata(),
             {
                 "addr": "127.0.0.2",
                 "port": "53",
                 "unique": "value2"
             },
             self.cib,
         ),
         [],
     )
Exemplo n.º 5
0
 def test_no_report_on_different_values(self):
     assert_report_item_list_equal(
         primitive._validate_unique_instance_attributes(
             self._fixture_metadata(),
             {
                 "addr": "127.0.0.2",
                 "port": "54",
                 "unique": "value2"
             },
             self.cib,
         ),
         [],
     )