예제 #1
0
 def test_disabled_wait_ok_not_running(self):
     self.runner.set_runs(fixture.call_dummy_metadata(
     ) + fixture.call_wait_supported() + fixture.calls_cib(
         self.fixture_resources_pre,
         self.fixture_resources_post_disabled,
         cib_base_file=self.upgraded_cib,
     ) + fixture.call_wait(10) + fixture.call_status(
         fixture.state_complete(self.fixture_status_primitive_not_running)))
     self.simplest_create(10, disabled=True)
     self.env.report_processor.assert_reports(
         [fixture.report_resource_not_running("A")])
     self.runner.assert_everything_launched()
예제 #2
0
 def test_wait_ok_run_fail(self):
     self.runner.set_runs(fixture.call_dummy_metadata(
     ) + fixture.call_wait_supported() + fixture.calls_cib(
         self.fixture_resources_pre,
         self.fixture_resources_post_simple,
         cib_base_file=self.upgraded_cib,
     ) + fixture.call_wait(10) + fixture.call_status(
         fixture.state_complete(self.fixture_status_primitive_not_running)))
     assert_raise_library_error(
         lambda: self.simplest_create(10),
         fixture.report_resource_not_running("A", severities.ERROR),
     )
     self.runner.assert_everything_launched()
예제 #3
0
 def test_wait_fail(self):
     self.runner.set_runs(
         fixture.call_dummy_metadata() + fixture.call_wait_supported() +
         fixture.calls_cib(
             self.fixture_resources_pre,
             self.fixture_resources_post_simple,
             cib_base_file=self.upgraded_cib,
         ) + fixture.call_wait(10, 62, self.fixture_wait_timeout_error))
     assert_raise_library_error(
         lambda: self.simplest_create(10),
         fixture.report_wait_for_idle_timed_out(
             self.fixture_wait_timeout_error),
     )
     self.runner.assert_everything_launched()
예제 #4
0
 def test_wait_ok_run_ok(self):
     self.runner.set_runs(
         fixture.call_dummy_metadata() + fixture.call_wait_supported() +
         fixture.calls_cib(
             self.fixture_resources_pre,
             self.fixture_resources_post_simple,
             cib_base_file=self.upgraded_cib,
         ) + fixture.call_wait(10) + fixture.call_status(
             fixture.state_complete(
                 self.fixture_status_running_with_primitive)))
     self.simplest_create(10)
     self.env.report_processor.assert_reports([
         fixture.report_resource_running("A", {"Started": ["node1"]}),
     ])
     self.runner.assert_everything_launched()
예제 #5
0
 def test_disabled_wait_ok_running(self):
     self.runner.set_runs(
         fixture.call_dummy_metadata() + fixture.call_wait_supported() +
         fixture.calls_cib(
             self.fixture_resources_pre,
             self.fixture_resources_post_disabled,
             cib_base_file=self.upgraded_cib,
         ) + fixture.call_wait(10) + fixture.call_status(
             fixture.state_complete(
                 self.fixture_status_running_with_primitive)))
     assert_raise_library_error(
         lambda: self.simplest_create(10, disabled=True),
         fixture.report_resource_running("A", {"Started": ["node1"]},
                                         severities.ERROR),
     )
     self.runner.assert_everything_launched()