Ejemplo n.º 1
0
 def _lint_cl_trimming(self):
     """Check that cl trimming is at least defined to prevent unbounded growth"""
     suffix = self.get_attr_val_utf8('nsslapd-suffix')
     replicas = Replicas(self._instance)
     replica = replicas.get(suffix)
     bename = self.lint_uid()
     if replica is not None:
         cl = Changelog(self._instance, suffix=suffix)
         try:
             if cl.get_attr_val_utf8('nsslapd-changelogmaxentries') is None and \
                cl.get_attr_val_utf8('nsslapd-changelogmaxage') is None:
                 report = copy.deepcopy(DSCLLE0001)
                 report['fix'] = report['fix'].replace(
                     'YOUR_INSTANCE', self._instance.serverid)
                 report['check'] = f'backends:{bename}::cl_trimming'
                 yield report
         except:
             # No changelog
             pass
Ejemplo n.º 2
0
 def _lint_cl_trimming(self):
     """Check that cl trimming is at least defined to prevent unbounded growth"""
     bename = self.lint_uid()
     suffix = self.get_attr_val_utf8('nsslapd-suffix')
     replicas = Replicas(self._instance)
     try:
         # Check if replication is enabled
         replicas.get(suffix)
         # Check the changelog
         cl = Changelog(self._instance, suffix=suffix)
         if cl.get_attr_val_utf8('nsslapd-changelogmaxentries') is None and \
            cl.get_attr_val_utf8('nsslapd-changelogmaxage') is None:
             report = copy.deepcopy(DSCLLE0001)
             report['fix'] = report['fix'].replace('YOUR_INSTANCE',
                                                   self._instance.serverid)
             report['check'] = f'backends:{bename}::cl_trimming'
             yield report
     except:
         # Suffix is not replicated
         self._log.debug(
             f"_lint_cl_trimming - backend ({suffix}) is not replicated")
         pass
Ejemplo n.º 3
0
def test_default_cl_trimming_enabled(topo_m2):
    """Check that changelog trimming was enabled by default

    :id: c37b9a28-f961-4867-b8a1-e81edd7f9bf3
    :setup: Supplier Instance
    :steps:
        1. Check changelog has trimming set up by default
    :expectedresults:
        1. Success
    """

    # Set up changelog trimming by default
    cl = Changelog(topo_m2.ms["supplier1"], DEFAULT_SUFFIX)
    assert cl.get_attr_val_utf8("nsslapd-changelogmaxage") == "7d"