Commit 5bf78616 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: ensure that alarm propagate parameters of orphaned Instance Tree

parent f7e60568
......@@ -9,4 +9,15 @@ portal.portal_catalog.searchAndActivate(
method_id='InstanceTree_assertSuccessor',
activate_kw={'tag': tag})
# Instance tree without any Software Instance
select_dict= {'successor__uid': None}
portal.portal_catalog.searchAndActivate(
portal_type='Instance Tree',
validation_state='validated',
method_id='InstanceTree_assertSuccessor',
activate_kw={'tag': tag},
left_join_list=select_dict.keys(),
**select_dict
)
context.activate(after_tag=tag).getId()
......@@ -67,7 +67,19 @@ class TestSlapOSCoreSlapOSAssertInstanceTreeSuccessorAlarm(
self.assertFalse(self.instance_tree.getTitle() in
self.instance_tree.getSuccessorTitleList())
def test_alarm_renamed(self):
def test_InstanceTree_assertSuccessor_alarm_orphaned(self):
instance_tree = self.portal.instance_tree_module.newContent(
portal_type='Instance Tree'
)
instance_tree.validate()
self.tic()
self._test_alarm(
self.portal.portal_alarms.slapos_assert_instance_tree_successor,
instance_tree,
'InstanceTree_assertSuccessor'
)
def test_InstanceTree_assertSuccessor_alarm_renamed(self):
self.software_instance.edit(title=self.generateNewSoftwareTitle())
self._test_alarm(
self.portal.portal_alarms.slapos_assert_instance_tree_successor,
......@@ -75,7 +87,7 @@ class TestSlapOSCoreSlapOSAssertInstanceTreeSuccessorAlarm(
'InstanceTree_assertSuccessor'
)
def test_alarm_not_renamed(self):
def test_InstanceTree_assertSuccessor_alarm_not_renamed(self):
self._test_alarm_not_visited(
self.portal.portal_alarms.slapos_assert_instance_tree_successor,
self.instance_tree,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment