#51087 Issue 49761 - Fix CI tests
Closed 3 years ago by spichugi. Opened 3 years ago by vashirov.
vashirov/389-ds-base update-stable-tests  into  master

@@ -21,7 +21,7 @@ 

  from lib389.idm.user import UserAccounts

  

  pytestmark = pytest.mark.tier2

- disk_monitoring_ack = pytest.mark.skipif(not os.environ.get('DISK_MONITORING_ACK', False), reason="GSSAPI tests may damage system configuration.")

+ disk_monitoring_ack = pytest.mark.skipif(not os.environ.get('DISK_MONITORING_ACK', False), reason="Disk monitoring tests may damage system configuration.")

  

  THRESHOLD = '30'

  THRESHOLD_BYTES = '30000000'

@@ -21,6 +21,7 @@ 

  from lib389.index import Index

  from lib389.idm.account import Accounts

  from lib389.idm.group import UniqueGroups

+ from lib389.utils import ds_is_older

  

  pytestmark = pytest.mark.tier1

  
@@ -165,7 +166,7 @@ 

      'Harry Miller',

      'Sam Schmith']

  

- 

+ @pytest.mark.xfail(ds_is_older('1.4.4'), reason="https://pagure.io/389-ds-base/issue/50201")

  def test_invalid_configuration(topo):

      """"

      Error handling for invalid configuration

@@ -500,6 +500,7 @@ 

      log.info('Check the error log for the error')

      assert topo_m4.ms["master1"].ds_error_log.match('.*nsds5ReplicaBackoffMax.*10.*invalid.*')

  

+ @pytest.mark.skipif(ds_is_older('1.4.4'), reason="Not implemented")

  def test_csngen_task(topo_m2):

      """Test csn generator test

  

@@ -319,7 +319,7 @@ 

          log.fatal('.ldif.done files are not present in %s - they should be' % changelog_dir)

          assert False

  

- @pytest.mark.skipif(ds_is_older("1.3.10.1"), reason="Not implemented")

+ @pytest.mark.skipif(ds_is_older("1.4.3"), reason="Not implemented")

  def test_dsconf_dump_changelog_files_removed(topo):

      """Verify that the python counterpart of cl-dump (using dsconf) has a correct management of generated files

  

@@ -48,7 +48,7 @@ 

      log.info("\n######################### Check PEM files (%s, %s, %s)%s in %s ######################\n"

               % (mycacert, myservercert, myserverkey, notexist, confdir))

      global cacert

-     cacert = '%s/%s.pem' % (confdir, mycacert)

+     cacert = f"{mycacert}.pem"

      if os.path.isfile(cacert):

          if notexist == "":

              log.info('%s is successfully generated.' % cacert)
@@ -61,7 +61,7 @@ 

              assert False

          else:

              log.info('%s is correctly not generated.' % cacert)

-     servercert = '%s/%s.pem' % (confdir, myservercert)

+     servercert = f"{myservercert}.pem"

      if os.path.isfile(servercert):

          if notexist == "":

              log.info('%s is successfully generated.' % servercert)
@@ -74,7 +74,7 @@ 

              assert False

          else:

              log.info('%s is correctly not generated.' % servercert)

-     serverkey = '%s/%s.pem' % (confdir, myserverkey)

+     serverkey = f"{myserverkey}.pem"

      if os.path.isfile(serverkey):

          if notexist == "":

              log.info('%s is successfully generated.' % serverkey)
@@ -91,16 +91,16 @@ 

  

  def relocate_pem_files(topology_m2):

      log.info("######################### Relocate PEM files on master1 ######################")

-     mycacert = 'MyCA'

+     certdir_prefix = "/dev/shm"

+     mycacert = os.path.join(certdir_prefix, "MyCA")

      topology_m2.ms["master1"].encryption.set('CACertExtractFile', mycacert)

-     myservercert = 'MyServerCert1'

-     myserverkey = 'MyServerKey1'

+     myservercert = os.path.join(certdir_prefix, "MyServerCert1")

+     myserverkey = os.path.join(certdir_prefix, "MyServerKey1")

      topology_m2.ms["master1"].rsa.apply_mods([(ldap.MOD_REPLACE, 'ServerCertExtractFile', myservercert),

                                                (ldap.MOD_REPLACE, 'ServerKeyExtractFile', myserverkey)])

      log.info("##### restart master1")

      topology_m2.ms["master1"].restart()

-     m1confdir = topology_m2.ms["master1"].confdir

-     check_pems(m1confdir, mycacert, myservercert, myserverkey, "")

+     check_pems(certdir_prefix, mycacert, myservercert, myserverkey, "")

  

  @pytest.mark.ds47536

  def test_openldap_no_nss_crypto(topology_m2):

@@ -54,6 +54,11 @@ 

      return TopologyInstance(instance)

  

  def test_setup_ds_minimal_dry(topology):

+     # Unset PYTHONPATH to avoid mixing old CLI tools and new lib389

+     tmp_env = os.environ

+     if "PYTHONPATH" in tmp_env:

+         del tmp_env["PYTHONPATH"]

+ 

      # Create the setupDs

      lc = LogCapture()

      # Give it the right types.

dirsrvtests/tests/suites/state/__init__.py dirsrvtests/tests/suites/stat/__init__.py
file renamed
file was moved with no change to the file
dirsrvtests/tests/suites/state/mmt_state_test.py dirsrvtests/tests/suites/stat/mmt_state_test.py
file renamed
file was moved with no change to the file

One more round of tests fixes.
Fix Description:

  • Update skipif/xfail pytest marks
  • Unset PYTHONPATH for cli tools in setup_ds tests
  • Change pem files extraction path in SASL regression tests
  • Fix a typo in 'state' tests directory name

Relates: https://pagure.io/389-ds-base/issue/49761

rebased onto 0ce27ed0bd9c8baf1ae11bcd85e5aa872993c323

3 years ago

rebased onto 893abb4718191efb49b0b6883af43ed24b211128

3 years ago

rebased onto 69883e307ff7219f7b36cce2b9caeb474d65dd66

3 years ago

rebased onto 592b4587fb93d5432ba320117417cd4ee50430d6

3 years ago

rebased onto 79086d3078c208e8c948b7b98279cf50288277f3

3 years ago

rebased onto 31351695cecd0b7a7f5fc7639b05f37f464f4932

3 years ago

rebased onto ab1aaad

3 years ago

Pull-Request has been merged by vashirov

3 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4140

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago