When the tests run on top of the entire ipatests package, the test runner (pytest) collects all of the tests and executes them. All of the integration tests (classes that use pytest_multihost) have built in check for the presence of configuration that must match the amount of resources in the test to be run. If there isn't a sufficient amount of resources available, the test is skipped with a message like this:
SKIP [1] /usr/lib/python2.7/site-packages/pytest_multihost/plugin.py:107: Not enough resources configured: Domain 0 not configured: {'hosts': {'replica': 1, 'master': 1, 'client': 0}, 'type': 'IPA'}
The teardown method introduced in the base class for replica promotion test cases intended to uninstall only clients and replicas is, however, running even after the test itself was skipped by the check for test resources. This leads to errors as the attributes the method tries to access hasn't been created on the test class instance.
./make-test -r s -x ipatests/test_integration/test_replica_promotion.py + IPA_UNIT_TEST_MODE=cli_test + PYTHONPATH=.: + py.test -r s -x ipatests/test_integration/test_replica_promotion.py =============================================================================================== test session starts ================================================================================================ platform linux2 -- Python 2.7.10 -- py-1.4.30 -- pytest-2.7.3 rootdir: /var/lib/jenkins/freeipa/ipatests, inifile: pytest.ini plugins: sourceorder, multihost collected 8 items ipatests/test_integration/test_replica_promotion.py sE ====================================================================================================== ERRORS ====================================================================================================== _____________________________________________________________________ ERROR at teardown of TestReplicaPromotionLevel0.test_kra_install_master ______________________________________________________________________ self = <ipatests.test_integration.test_replica_promotion.TestReplicaPromotionLevel0 object at 0x7f2692a5a750> method = <bound method TestReplicaPromotionLevel0.test_kra_install_master of <ipatests....on.test_replica_promotion.TestReplicaPromotionLevel0 object at 0x7f2692a5a750>> def teardown_method(self, method): > for host in self.replicas: E AttributeError: 'TestReplicaPromotionLevel0' object has no attribute 'replicas' ipatests/test_integration/test_replica_promotion.py:16: AttributeError ============================================================================================= short test summary info ============================================================================================== SKIP [1] /usr/lib/python2.7/site-packages/pytest_multihost/plugin.py:107: Not enough resources configured: Domain 0 not configured: {'hosts': {'replica': 1, 'master': 1, 'client': 0}, 'type': 'IPA'} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ======================================================================================== 1 skipped, 1 error in 0.26 seconds ========================================================================================
I forgot a word:
This leads to errors as the attributes the method tries to access attributes that hasn't been created on the test class instance.
I suggest to close this ticket and continue with #5723, because that ticket is still opened
Metadata Update from @mkubik: - Issue assigned to ofayans - Issue set to the milestone: 0.0 NEEDS_TRIAGE