示例#1
0
    def test_ssd(self):
        (info, events) = get_data_file_text("single-controller-ssd.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()
        self.assertTrue(result)
        self.assertTrue(len(errors) == 0)
示例#2
0
    def test_invalid_events(self):
        # If the events file is invalid, there should be no events
        (info, events) = get_data_file_text("single-controller.txt",
                                            "invalid-events.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()
        self.assertTrue(result)
        self.assertFalse(errors)
    def test_1(self):
        (info, events) = get_data_file_text("single-controller-hba.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()
        self.assertTrue(result)
        self.assertTrue(len(errors) == 0)
        self.assertTrue("Controller" in repr(c))
        self.assertTrue(len(c._vd_info) == 0)
        self.assertTrue(len(c._pd_info) == 0)
示例#4
0
    def test_report_as_html(self):
        (info, events) = get_data_file_text("single-controller-offline.txt")
        c = storcli_check.Controller(info, events, self.logger)
        report = c.report_as_html()

        for substring in [
                "<b>PD Status</b>",
                "24:15&nbsp;&nbsp;&nbsp;&nbsp;15&nbsp;Onln",
                "1/1&nbsp;&nbsp;&nbsp;RAID10&nbsp;OfLn", "Firmware Package:"
        ]:
            self.assertTrue(substring in report)
示例#5
0
    def test_missing_drive_count(self):
        (info, events
         ) = get_data_file_text("single-controller-missing-drive-count.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()
        self.assertTrue(result)
        self.assertTrue(len(errors) == 0)
        self.assertTrue("Controller" in repr(c))
        self.assertTrue(len(c._vd_info) == 2)
        self.assertTrue(len(c._pd_info) == 16)
        self.assertTrue(c._cv_info)
        self.assertFalse(c._event_info)
示例#6
0
    def test_bad_events(self):
        (info, events) = get_data_file_text("single-controller.txt",
                                            "bad-events.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()
        self.assertFalse(result)
        self.assertTrue(errors)
        self.assertTrue("Controller" in repr(c))
        self.assertTrue(len(c._vd_info) == 2)
        self.assertTrue(len(c._pd_info) == 16)
        self.assertTrue(c._cv_info)
        self.assertTrue(len(c._event_info) == 3)
示例#7
0
    def test_offline(self):
        (info, events) = get_data_file_text("single-controller-offline.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()
        self.assertFalse(result)
        self.assertTrue(len(errors) == 3)
        self.assertTrue("ofln" in errors[0])
        self.assertTrue("offln" in errors[1])
        self.assertTrue("offln" in errors[2])

        self.assertTrue("Controller" in repr(c))
        self.assertTrue(len(c._vd_info) == 2)
        self.assertTrue(len(c._pd_info) == 16)
        self.assertTrue(c._cv_info)
        self.assertFalse(c._event_info)
示例#8
0
    def test_degraded(self):
        (info, events) = get_data_file_text("single-controller-degraded.txt")

        c = storcli_check.Controller(info, events, self.logger)
        result, errors = c.ok()

        self.assertFalse(result)
        self.assertTrue(len(errors) == 3)
        self.assertTrue([x for x in errors if "dgrd" in x])
        self.assertTrue([x for x in errors if "offln" in x])
        self.assertTrue([x for x in errors if "failure" in x])

        self.assertTrue("Controller" in repr(c))
        self.assertTrue(len(c._vd_info) == 2)
        self.assertTrue(len(c._pd_info) == 16)
        self.assertTrue(c._cv_info)
        self.assertFalse(c._event_info)