def test_group_running(self): resources_state = fixture.complete_state_resources( etree.fromstring(""" <resources> <group id="G" number_resources="2"> <resource id="R1" role="Started" nodes_running_on="1"> <node name="node1" id="1" cached="false" /> </resource> <resource id="R2" role="Started" nodes_running_on="1"> <node name="node1" id="1" cached="false" /> </resource> </group> </resources> """)) self.config.runner.pcmk.load_state( resources=etree_to_str(resources_state)) resource.group_add( self.env_assist.get_env(), "G", ["R1", "R2"], wait=self.timeout, ) self.env_assist.assert_reports([ fixture.report_resource_running("G", {"Started": ["node1"]}), ])
def test_wait_ok_running(self): (self.config.runner.pcmk.load_state( resources=self.fixture_status_running)) simple_bundle_update(self.env_assist.get_env()) self.env_assist.assert_reports([ fixture.report_resource_running("B1", {"Started": ["node1", "node2"]}), ])
def test_wait_ok_run_ok(self): (self.config.env.push_cib(resources=fixture_resources_bundle_simple, wait=TIMEOUT).runner.pcmk.load_state( resources=self.fixture_status_running)) simple_bundle_create(self.env_assist.get_env()) self.env_assist.assert_reports([ fixture.report_resource_running("B1", {"Started": ["node1", "node2"]}), ])
def test_disabled_wait_ok_run_fail(self): (self.config.env.push_cib( resources=self.fixture_resources_bundle_simple_disabled, wait=TIMEOUT).runner.pcmk.load_state( resources=self.fixture_status_running)) self.env_assist.assert_raise_library_error( lambda: self.run_bundle_cmd(ensure_disabled=True, wait=TIMEOUT), [ fixture.report_resource_running( self.bundle_id, {"Started": ["node1", "node2"]}, severities.ERROR) ])