ed91e8d ipatests: fix replica uninstallation in test_integration/test_server_del.py

Authored and Committed by sorlov 4 years ago
    ipatests: fix replica uninstallation in test_integration/test_server_del.py
    
    In ipa-4-6 branch test_integration/test_server_del.py fails in
    test_ignore_topology_disconnect_replica1 at step tasks.uninstall_master
    
    This happens because:
    1. ipa-server-install --uninstall must be called with
       --ignore-topology-disconnect, similar to previous execution of
       "ipa server del"
    2. tasks.uninstall_master adds this option only if domain level is 1
    3. tasks.uninstall_master calls domainlevel() which executes
       "ipa domainlevel-get"
    4. this command fails in our case as records for all services have been removed from ldap and ipa command fails to authorize at kerberos
    5. domainlevel() returns default value in this case, which is 0 in ipa-4-6,
       so --ignore-topology-disconnect option is not used, unintsallation
       stops and the test fails.
    
    In master and ipa-4-7 it was fixed by commit 13000e2, part of PR which
    dropped support for domain level 0 (https://pagure.io/freeipa/issue/7669).
    As dropping domain level 0 is not planned for ipa-4-6, I added an option
    to tasks.uninstall_master to explicitly specify the domain level.
    
    Fixes https://pagure.io/freeipa/issue/7931
    
    Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
    Reviewed-By: Rob Crittenden <rcritten@redhat.com>