コード例 #1
0
 def test_success(self):
     report_list = []
     report_list.extend(
         lib._validate_devices(self.resources_el, ["stonith1"]))
     report_list.extend(
         lib._validate_devices(self.resources_el, ["stonith1", "stonith2"]))
     assert_report_item_list_equal(report_list, [])
コード例 #2
0
 def test_invalid(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(reporter, self.resources_el, ["dummy", "fenceX"])
     report = [(severity.ERROR, report_codes.STONITH_RESOURCES_DO_NOT_EXIST,
                {
                    "stonith_ids": ["dummy", "fenceX"],
                }, report_codes.FORCE_STONITH_RESOURCE_DOES_NOT_EXIST)]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #3
0
 def test_empty(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(reporter, self.resources_el, [])
     report = [(severity.ERROR, report_codes.REQUIRED_OPTION_IS_MISSING, {
         "option_type": None,
         "option_names": ["stonith devices"],
     }, None)]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #4
0
 def test_success(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(
         reporter, self.resources_el, ["stonith1"]
     )
     lib._validate_devices(
         reporter, self.resources_el, ["stonith1", "stonith2"]
     )
     assert_report_item_list_equal(reporter.report_item_list, [])
コード例 #5
0
ファイル: test_fencing_topology.py プロジェクト: junaruga/pcs
 def test_success(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(
         reporter, self.resources_el, ["stonith1"]
     )
     lib._validate_devices(
         reporter, self.resources_el, ["stonith1", "stonith2"]
     )
     assert_report_item_list_equal(reporter.report_item_list, [])
コード例 #6
0
 def test_node_invalid_not_forceable(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(reporter,
                           self.resources_el, ["dummy", "fenceX"],
                           allow_force=False)
     report = [(severity.ERROR, report_codes.STONITH_RESOURCES_DO_NOT_EXIST,
                {
                    "stonith_ids": ["dummy", "fenceX"],
                }, None)]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #7
0
 def test_invalid_forced(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(reporter,
                           self.resources_el, ["dummy", "fenceX"],
                           force_device=True)
     report = [(severity.WARNING,
                report_codes.STONITH_RESOURCES_DO_NOT_EXIST, {
                    "stonith_ids": ["dummy", "fenceX"],
                }, None)]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #8
0
 def test_invalid(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(reporter, self.resources_el, ["dummy", "fenceX"])
     report = [(
         severity.ERROR,
         report_codes.STONITH_RESOURCES_DO_NOT_EXIST,
         {
             "stonith_ids": ["dummy", "fenceX"],
         },
         report_codes.FORCE_STONITH_RESOURCE_DOES_NOT_EXIST
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #9
0
 def test_empty(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(reporter, self.resources_el, [])
     report = [(
         severity.ERROR,
         report_codes.REQUIRED_OPTION_IS_MISSING,
         {
             "option_type": None,
             "option_names": ["stonith devices"],
         },
         None
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #10
0
 def test_node_invalid_not_forceable(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(
         reporter, self.resources_el, ["dummy", "fenceX"], allow_force=False
     )
     report = [(
         severity.ERROR,
         report_codes.STONITH_RESOURCES_DO_NOT_EXIST,
         {
             "stonith_ids": ["dummy", "fenceX"],
         },
         None
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #11
0
 def test_invalid_forced(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_devices(
         reporter, self.resources_el, ["dummy", "fenceX"], force_device=True
     )
     report = [(
         severity.WARNING,
         report_codes.STONITH_RESOURCES_DO_NOT_EXIST,
         {
             "stonith_ids": ["dummy", "fenceX"],
         },
         None
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
コード例 #12
0
 def test_empty(self):
     report_list = lib._validate_devices(self.resources_el, [])
     report = [(severity.ERROR, report_codes.REQUIRED_OPTIONS_ARE_MISSING, {
         "option_type": None,
         "option_names": ["stonith devices"],
     }, None)]
     assert_report_item_list_equal(report_list, report)
コード例 #13
0
ファイル: test_fencing_topology.py プロジェクト: vvidic/pcs
 def test_invalid(self):
     report_list = lib._validate_devices(self.resources_el,
                                         ["dummy", "fenceX"])
     report = [(
         severity.ERROR,
         report_codes.STONITH_RESOURCES_DO_NOT_EXIST,
         {
             "stonith_ids": ["dummy", "fenceX"],
         },
         report_codes.FORCE,
     )]
     assert_report_item_list_equal(report_list, report)