Esempio n. 1
0
 def test_disabled_wait_ok_run_ok(self):
     self.runner.set_runs(fixture.call_wait_supported() + fixture.calls_cib(
         self.fixture_cib_pre,
         self.fixture_resources_bundle_simple_disabled,
         cib_base_file=self.cib_base_file,
     ) + fixture.call_wait(self.timeout) + fixture.call_status(
         fixture.state_complete(self.fixture_status_not_running)))
     self.simple_bundle_create(self.timeout, disabled=True)
     self.runner.assert_everything_launched()
Esempio n. 2
0
 def test_wait_ok_run_fail(self):
     self.runner.set_runs(
         self.fixture_calls_initial() + fixture.call_wait(self.timeout) +
         fixture.call_status(
             fixture.state_complete(self.fixture_status_not_running)))
     assert_raise_library_error(
         lambda: self.simple_bundle_create(self.timeout),
         fixture.report_resource_not_running("B1", severities.ERROR),
     )
     self.runner.assert_everything_launched()
Esempio n. 3
0
 def test_wait_ok_not_running(self):
     self.runner.set_runs(
         self.fixture_calls_initial() + fixture.call_wait(self.timeout) +
         fixture.call_status(
             fixture.state_complete(self.fixture_status_not_running)))
     self.simple_bundle_update(self.timeout)
     self.env.report_processor.assert_reports([
         fixture.report_resource_not_running("B1", severities.INFO),
     ])
     self.runner.assert_everything_launched()
Esempio n. 4
0
 def test_wait_ok_run_ok(self):
     self.runner.set_runs(
         self.fixture_calls_initial() + fixture.call_wait(self.timeout) +
         fixture.call_status(
             fixture.state_complete(self.fixture_status_running)))
     self.simple_bundle_create(self.timeout)
     self.env.report_processor.assert_reports([
         fixture.report_resource_running("B1",
                                         {"Started": ["node1", "node2"]}),
     ])
     self.runner.assert_everything_launched()
Esempio n. 5
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()
Esempio n. 6
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()
Esempio n. 7
0
 def test_disabled_wait_ok_run_fail(self):
     self.runner.set_runs(fixture.call_wait_supported() + fixture.calls_cib(
         self.fixture_cib_pre,
         self.fixture_resources_bundle_simple_disabled,
         cib_base_file=self.cib_base_file,
     ) + fixture.call_wait(self.timeout) + fixture.call_status(
         fixture.state_complete(self.fixture_status_running)))
     assert_raise_library_error(
         lambda: self.simple_bundle_create(self.timeout, disabled=True),
         fixture.report_resource_running("B1",
                                         {"Started": ["node1", "node2"]},
                                         severities.ERROR))
     self.runner.assert_everything_launched()
Esempio n. 8
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()
Esempio n. 9
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()