Esempio n. 1
0
    def test_nonexistent_resource(self):
        (self.config.runner.cib.load(resources=fixture_primitive_cib_managed))

        self.env_assist.assert_raise_library_error(
            lambda: resource.unmanage(self.env_assist.get_env(), ["B"]),
            [fixture.report_not_found("B", "resources")],
            expected_in_processor=False)
Esempio n. 2
0
    def test_nonexistent_resource(self):
        self.runner.set_runs(
            fixture.call_cib_load(
                fixture.cib_resources(fixture_primitive_cib_managed)))

        assert_raise_library_error(lambda: resource.unmanage(self.env, ["B"]),
                                   fixture.report_not_found("B", "resources"))
        self.runner.assert_everything_launched()
Esempio n. 3
0
    def test_bad_resource_unmanage(self):
        (self.config.runner.cib.load(resources=self.fixture_cib_managed))

        self.env_assist.assert_raise_library_error(lambda: resource.unmanage(
            self.env_assist.get_env(), ["B", "X", "Y", "A"]), [
                fixture.report_not_found("X", "resources"),
                fixture.report_not_found("Y", "resources"),
            ],
                                                   expected_in_processor=False)
Esempio n. 4
0
    def test_bundle(self):
        self.runner.set_runs(
            fixture.call_cib_load(
                fixture.cib_resources(fixture_bundle_cib_managed)))

        assert_raise_library_error(
            lambda: resource.unmanage(self.env, ["A-bundle"], False),
            fixture.report_not_for_bundles("A-bundle"))
        self.runner.assert_everything_launched()
Esempio n. 5
0
    def test_bad_resource_unmanage(self):
        self.runner.set_runs(
            fixture.call_cib_load(
                fixture.cib_resources(self.fixture_cib_managed)))

        assert_raise_library_error(
            lambda: resource.unmanage(self.env, ["B", "X", "Y", "A"]),
            fixture.report_not_found("X", "resources"),
            fixture.report_not_found("Y", "resources"),
        )
        self.runner.assert_everything_launched()
Esempio n. 6
0
 def test_success_unmanage(self):
     fixture_cib_unmanaged = """
         <resources>
             <primitive class="ocf" id="A" provider="heartbeat" type="Dummy">
                 <meta_attributes id="A-meta_attributes">
                     <nvpair id="A-meta_attributes-is-managed"
                         name="is-managed" value="false" />
                 </meta_attributes>
             </primitive>
             <primitive class="ocf" id="B" provider="heartbeat" type="Dummy">
             </primitive>
             <primitive class="ocf" id="C" provider="heartbeat" type="Dummy">
                 <meta_attributes id="C-meta_attributes">
                     <nvpair id="C-meta_attributes-is-managed"
                         name="is-managed" value="false" />
                 </meta_attributes>
             </primitive>
         </resources>
     """
     (self.config.runner.cib.load(
         resources=self.fixture_cib_managed).env.push_cib(
             resources=fixture_cib_unmanaged))
     resource.unmanage(self.env_assist.get_env(), ["A", "C"])
Esempio n. 7
0
 def test_success_unmanage(self):
     fixture_cib_unmanaged = """
         <resources>
             <primitive class="ocf" id="A" provider="heartbeat" type="Dummy">
                 <meta_attributes id="A-meta_attributes">
                     <nvpair id="A-meta_attributes-is-managed"
                         name="is-managed" value="false" />
                 </meta_attributes>
             </primitive>
             <primitive class="ocf" id="B" provider="heartbeat" type="Dummy">
             </primitive>
             <primitive class="ocf" id="C" provider="heartbeat" type="Dummy">
                 <meta_attributes id="C-meta_attributes">
                     <nvpair id="C-meta_attributes-is-managed"
                         name="is-managed" value="false" />
                 </meta_attributes>
             </primitive>
         </resources>
     """
     self.assert_command_effect(
         self.fixture_cib_managed,
         lambda: resource.unmanage(self.env, ["A", "C"]),
         fixture_cib_unmanaged)
Esempio n. 8
0
 def test_unmanage_in_cloned_group(self):
     self.assert_command_effect(
         fixture_clone_group_cib_managed_op_enabled,
         lambda: resource.unmanage(self.env, ["A1"], True),
         fixture_clone_group_cib_unmanaged_primitive_op_disabled)
 def test_bundle_empty(self):
     self.assert_command_effect(
         fixture_bundle_empty_cib_managed,
         lambda: resource.unmanage(self.env, ["A-bundle"]),
         fixture_bundle_empty_cib_unmanaged_bundle
     )
Esempio n. 10
0
 def test_primitive(self):
     (self.config.runner.cib.load(
         resources=fixture_bundle_cib_managed).env.push_cib(
             resources=fixture_bundle_cib_unmanaged_primitive))
     resource.unmanage(self.env_assist.get_env(), ["A"])
Esempio n. 11
0
 def test_unmanage_clone_with_group(self):
     (self.config.runner.cib.load(
         resources=fixture_clone_group_cib_managed_op_enabled).env.push_cib(
             resources=
             fixture_clone_group_cib_unmanaged_all_primitives_op_disabled))
     resource.unmanage(self.env_assist.get_env(), ["A-clone"], True)
Esempio n. 12
0
 def test_primitive(self):
     self.assert_command_effect(fixture_bundle_cib_managed,
                                lambda: resource.unmanage(self.env, ["A"]),
                                fixture_bundle_cib_unmanaged_primitive)
Esempio n. 13
0
 def test_clone(self):
     self.assert_command_effect(
         fixture_clone_group_cib_managed,
         lambda: resource.unmanage(self.env, ["A-clone"]),
         fixture_clone_group_cib_unmanaged_all_primitives)
Esempio n. 14
0
 def test_master(self):
     self.assert_command_effect(
         fixture_master_cib_managed,
         lambda: resource.unmanage(self.env, ["A-master"]),
         fixture_master_cib_unmanaged_primitive)
Esempio n. 15
0
 def test_group(self):
     self.assert_command_effect(fixture_group_cib_managed,
                                lambda: resource.unmanage(self.env, ["A"]),
                                fixture_group_cib_unmanaged_all_resources)
Esempio n. 16
0
 def test_unmanage_noop(self):
     (self.config.runner.cib.load(
         resources=fixture_primitive_cib_managed).env.push_cib(
             resources=fixture_primitive_cib_unmanaged))
     resource.unmanage(self.env_assist.get_env(), ["A"], True)
Esempio n. 17
0
 def test_unmanage_enabled_monitors(self):
     (self.config.runner.cib.load(
         resources=fixture_primitive_cib_managed_op_enabled).env.push_cib(
             resources=fixture_primitive_cib_unmanaged_op_enabled))
     resource.unmanage(self.env_assist.get_env(), ["A"], False)
Esempio n. 18
0
 def test_unmanage_noop(self):
     self.assert_command_effect(
         fixture_primitive_cib_managed,
         lambda: resource.unmanage(self.env, ["A"], True),
         fixture_primitive_cib_unmanaged)
Esempio n. 19
0
 def test_unmanage_in_bundle(self):
     (self.config.runner.cib.load(
         resources=fixture_bundle_cib_managed_op_enabled).env.push_cib(
             resources=fixture_bundle_cib_unmanaged_primitive_op_disabled))
     resource.unmanage(self.env_assist.get_env(), ["A"], True)
Esempio n. 20
0
 def test_unmanage_enabled_monitors(self):
     self.assert_command_effect(
         fixture_primitive_cib_managed_op_enabled,
         lambda: resource.unmanage(self.env, ["A"], False),
         fixture_primitive_cib_unmanaged_op_enabled)
Esempio n. 21
0
 def test_clone(self):
     (self.config.runner.cib.load(
         resources=fixture_clone_group_cib_managed).env.push_cib(
             resources=fixture_clone_group_cib_unmanaged_all_primitives))
     resource.unmanage(self.env_assist.get_env(), ["A-clone"])
Esempio n. 22
0
 def test_unmanage_in_master(self):
     self.assert_command_effect(
         fixture_master_cib_managed_op_enabled,
         lambda: resource.unmanage(self.env, ["A"], True),
         fixture_master_cib_unmanaged_primitive_op_disabled)
Esempio n. 23
0
 def test_bundle_empty(self):
     (self.config.runner.cib.load(
         resources=fixture_bundle_empty_cib_managed).env.push_cib(
             resources=fixture_bundle_empty_cib_unmanaged_bundle))
     resource.unmanage(self.env_assist.get_env(), ["A-bundle"])
 def test_unmanage_bundle(self):
     self.assert_command_effect(
         fixture_bundle_cib_managed_op_enabled,
         lambda: resource.unmanage(self.env, ["A-bundle"], True),
         fixture_bundle_cib_unmanaged_both_op_disabled
     )