From c00ef655201a08055a4cc17ee75712022ad9855e Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Mar 01 2018 11:46:54 +0000 Subject: Issue 49584 - Fix issues with paged_results test suite Bug Description: The test fails because the instance now uses hostname for ldap URL but the ACI is set to localhost URL. Fix description: Get FQDN and IP addresses of the machine and use them for ACI creation. https://pagure.io/389-ds-base/issue/49584 Reviewed by: mreynolds, wibrown (Thanks!) --- diff --git a/dirsrvtests/tests/suites/paged_results/paged_results_test.py b/dirsrvtests/tests/suites/paged_results/paged_results_test.py index 49fb85d..8f2cadb 100644 --- a/dirsrvtests/tests/suites/paged_results/paged_results_test.py +++ b/dirsrvtests/tests/suites/paged_results/paged_results_test.py @@ -6,6 +6,7 @@ # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # +import socket from random import sample import pytest @@ -42,6 +43,9 @@ NEW_SUFFIX_2 = 'ou={},{}'.format(NEW_SUFFIX_2_NAME, NEW_SUFFIX_1) NEW_BACKEND_1 = 'parent_base' NEW_BACKEND_2 = 'child_base' +HOSTNAME = socket.getfqdn() +IP_ADDRESS = socket.gethostbyname(HOSTNAME) + @pytest.fixture(scope="module") def test_user(topology_st, request): @@ -500,8 +504,8 @@ def test_search_with_timelimit(topology_st, test_user): @pytest.mark.parametrize('aci_subject', - ('dns = "localhost.localdomain"', - 'ip = "::1" or ip = "127.0.0.1"')) + ('dns = "{}"'.format(HOSTNAME), + 'ip = "{}"'.format(IP_ADDRESS))) def test_search_dns_ip_aci(topology_st, test_user, aci_subject): """Verify that after performing multiple simple paged searches to completion on the suffix with DNS or IP based ACI diff --git a/src/lib389/lib389/topologies.py b/src/lib389/lib389/topologies.py index cde8fe3..0c08c96 100644 --- a/src/lib389/lib389/topologies.py +++ b/src/lib389/lib389/topologies.py @@ -80,7 +80,6 @@ def create_topology(topo_dict, suffix=DEFAULT_SUFFIX): elif role != ReplicaRole.STANDALONE: raise AssertionError("Invalid request to make suffix-less replicated environment") - instance.allocate(args_instance) instance_exists = instance.exists()