Changeset f9dc250 in trunk


Ignore:
Timestamp:
2020-07-10T12:00:04Z (5 years ago)
Author:
Sajith Sasidharan <sajith@…>
Branches:
master
Children:
69ae9e6d
Parents:
427f996
Message:

Test "deep check and repair" page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/test/test_checker.py

    r427f996 rf9dc250  
    33import json
    44import os.path, shutil
     5
     6from bs4 import BeautifulSoup
     7
    58from twisted.trial import unittest
    69from twisted.internet import defer
     
    2730)
    2831
     32from .web.common import (
     33    assert_soup_has_favicon,
     34    assert_soup_has_tag_with_content,
     35)
     36
    2937class FakeClient(object):
    3038    def get_storage_broker(self):
     
    4149        self.args = args or {}
    4250        self.fields = fields or {}
     51        self.prepath = [b""]
    4352
    4453class WebResultsRendering(unittest.TestCase):
     
    337346        _got_lit_results(d)
    338347
     348    def test_deep_check_and_repair_renderer(self):
     349        monitor = Monitor()
     350        status = check_results.DeepCheckAndRepairResults("")
     351        monitor.set_status(status)
     352        elem = web_check_results.DeepCheckAndRepairResultsRendererElement(monitor)
     353        doc = self.render_element(elem)
     354        soup = BeautifulSoup(doc, 'html5lib')
     355
     356        assert_soup_has_favicon(self, soup)
     357
     358        assert_soup_has_tag_with_content(
     359            self, soup, u"title",
     360            u"Tahoe-LAFS - Deep Check Results"
     361        )
     362
     363        assert_soup_has_tag_with_content(
     364            self, soup, u"h1",
     365            u"Deep-Check-And-Repair Results for root SI="
     366        )
     367
     368        assert_soup_has_tag_with_content(
     369            self, soup, u"li",
     370            u"Objects Checked: 0"
     371        )
     372
     373        assert_soup_has_tag_with_content(
     374            self, soup, u"li",
     375            u"Objects Healthy (before repair): 0"
     376        )
     377
     378        assert_soup_has_tag_with_content(
     379            self, soup, u"li",
     380            u"Objects Unhealthy (before repair): 0"
     381        )
     382
     383        assert_soup_has_tag_with_content(
     384            self, soup, u"li",
     385            u"Corrupt Shares (before repair): 0"
     386        )
     387
     388        assert_soup_has_tag_with_content(
     389            self, soup, u"li",
     390            u"Repairs Attempted: 0"
     391        )
     392
     393        assert_soup_has_tag_with_content(
     394            self, soup, u"li",
     395            u"Repairs Attempted: 0"
     396        )
     397
     398        assert_soup_has_tag_with_content(
     399            self, soup, u"li",
     400            u"Repairs Successful: 0"
     401        )
     402
     403        assert_soup_has_tag_with_content(
     404            self, soup, u"li",
     405            "Repairs Unsuccessful: 0"
     406        )
     407
     408        assert_soup_has_tag_with_content(
     409            self, soup, u"li",
     410            u"Objects Healthy (after repair): 0"
     411        )
     412
     413        assert_soup_has_tag_with_content(
     414            self, soup, u"li",
     415            u"Objects Unhealthy (after repair): 0"
     416        )
     417
     418        assert_soup_has_tag_with_content(
     419            self, soup, u"li",
     420            u"Corrupt Shares (after repair): 0"
     421        )
     422
     423        assert_soup_has_tag_with_content(
     424            self, soup, u"h2",
     425            u"Files/Directories That Had Problems:"
     426        )
     427
     428        assert_soup_has_tag_with_content(
     429            self, soup, u"h2",
     430            u"Files/Directories That Still Have Problems:"
     431        )
     432
     433        assert_soup_has_tag_with_content(
     434            self, soup, u"h2",
     435            u"Servers on which corrupt shares were found"
     436        )
     437
     438        assert_soup_has_tag_with_content(
     439            self, soup, u"h2",
     440            u"Remaining Corrupt Shares"
     441        )
     442
     443
    339444class BalancingAct(GridTestMixin, unittest.TestCase):
    340445    # test for #1115 regarding the 'count-good-share-hosts' metric
Note: See TracChangeset for help on using the changeset viewer.