Esempio n. 1
0
 def test_topology_updated_on_replica_install_remove(self):
     """
     Install and remove a replica and make sure topology information is
     updated on all other replicas
     Testcase: http://www.freeipa.org/page/V4/Manage_replication_topology/
     Test_plan#Test_case:
     _Replication_topology_should_be_saved_in_the_LDAP_tree
     """
     tasks.kinit_admin(self.master)
     result1 = self.master.run_command(['ipa', 'topologysegment-find',
                                        DOMAIN_SUFFIX_NAME]).stdout_text
     first_segment_name = "%s-to-%s" % (self.master.hostname,
                                        self.replicas[0].hostname)
     expected_segment = {
         'connectivity': 'both',
         'leftnode': self.master.hostname,
         'name': first_segment_name,
         'rightnode': self.replicas[0].hostname}
     firstsegment = self.tokenize_topologies(result1)[0]
     assert_deepequal(expected_segment, firstsegment)
     tasks.install_replica(self.master, self.replicas[1], setup_ca=False,
                           setup_dns=False)
     # We need to make sure topology information is consistent across all
     # replicas
     result2 = self.master.run_command(['ipa', 'topologysegment-find',
                                        DOMAIN_SUFFIX_NAME])
     result3 = self.replicas[0].run_command(['ipa', 'topologysegment-find',
                                             DOMAIN_SUFFIX_NAME])
     result4 = self.replicas[1].run_command(['ipa', 'topologysegment-find',
                                             DOMAIN_SUFFIX_NAME])
     segments = self.tokenize_topologies(result2.stdout_text)
     assert(len(segments) == 2), "Unexpected number of segments found"
     assert_deepequal(result2.stdout_text, result3.stdout_text)
     assert_deepequal(result3.stdout_text,  result4.stdout_text)
     # Now let's check that uninstalling the replica will update the topology
     # info on the rest of replicas.
     tasks.uninstall_master(self.replicas[1])
     tasks.clean_replication_agreement(self.master, self.replicas[1])
     result5 = self.master.run_command(['ipa', 'topologysegment-find',
                                        DOMAIN_SUFFIX_NAME])
     num_entries = self.noentries_re.search(result5.stdout_text).group(1)
     assert(num_entries == "1"), "Incorrect number of entries displayed"
Esempio n. 2
0
 def test_topology_updated_on_replica_install_remove(self):
     """
     Install and remove a replica and make sure topology information is
     updated on all other replicas
     Testcase: http://www.freeipa.org/page/V4/Manage_replication_topology/
     Test_plan#Test_case:
     _Replication_topology_should_be_saved_in_the_LDAP_tree
     """
     tasks.kinit_admin(self.master)
     result1 = self.master.run_command(['ipa', 'topologysegment-find',
                                        DOMAIN_SUFFIX_NAME])
     first_segment_name = "%s-to-%s" % (self.master.hostname,
                                        self.replicas[0].hostname)
     output1 = result1.stdout_text
     firstsegment = self.tokenize_topologies(output1)[0]
     assert(firstsegment['name'] == first_segment_name)
     assert(self.noentries_re.search(output1).group(1) == "1")
     assert(firstsegment['leftnode'] == self.master.hostname)
     assert(firstsegment['rightnode'] == self.replicas[0].hostname)
     tasks.install_replica(self.master, self.replicas[1], setup_ca=False,
                           setup_dns=False)
     # We need to make sure topology information is consistent across all
     # replicas
     result2 = self.master.run_command(['ipa', 'topologysegment-find',
                                        DOMAIN_SUFFIX_NAME])
     result3 = self.replicas[0].run_command(['ipa', 'topologysegment-find',
                                             DOMAIN_SUFFIX_NAME])
     result4 = self.replicas[1].run_command(['ipa', 'topologysegment-find',
                                             DOMAIN_SUFFIX_NAME])
     segments = self.tokenize_topologies(result2.stdout_text)
     assert(len(segments) == 2)
     assert(result2.stdout_text == result3.stdout_text)
     assert(result3.stdout_text == result4.stdout_text)
     # Now let's check that uninstalling the replica will update the topology
     # info on the rest of replicas.
     tasks.uninstall_master(self.replicas[1])
     tasks.clean_replication_agreement(self.master, self.replicas[1])
     result5 = self.master.run_command(['ipa', 'topologysegment-find',
                                        DOMAIN_SUFFIX_NAME])
     assert(self.noentries_re.search(result5.stdout_text).group(1) == "1")
Esempio n. 3
0
 def test_topology_updated_on_replica_install_remove(self):
     """
     Install and remove a replica and make sure topology information is
     updated on all other replicas
     Testcase: http://www.freeipa.org/page/V4/Manage_replication_topology/
     Test_plan#Test_case:
     _Replication_topology_should_be_saved_in_the_LDAP_tree
     """
     tasks.kinit_admin(self.master)
     result1 = self.master.run_command(
         ['ipa', 'topologysegment-find', DOMAIN_SUFFIX_NAME]).stdout_text
     segment_name = self.segmentnames_re.findall(result1)[0]
     assert (self.master.hostname in segment_name), (
         "Segment %s does not contain master hostname" % segment_name)
     assert (self.replicas[0].hostname in segment_name), (
         "Segment %s does not contain replica hostname" % segment_name)
     tasks.install_replica(self.master,
                           self.replicas[1],
                           setup_ca=False,
                           setup_dns=False)
     # We need to make sure topology information is consistent across all
     # replicas
     result2 = self.master.run_command(
         ['ipa', 'topologysegment-find', DOMAIN_SUFFIX_NAME])
     result3 = self.replicas[0].run_command(
         ['ipa', 'topologysegment-find', DOMAIN_SUFFIX_NAME])
     result4 = self.replicas[1].run_command(
         ['ipa', 'topologysegment-find', DOMAIN_SUFFIX_NAME])
     segments = self.tokenize_topologies(result2.stdout_text)
     assert (len(segments) == 2), "Unexpected number of segments found"
     assert_deepequal(result2.stdout_text, result3.stdout_text)
     assert_deepequal(result3.stdout_text, result4.stdout_text)
     # Now let's check that uninstalling the replica will update the topology
     # info on the rest of replicas.
     tasks.uninstall_master(self.replicas[1])
     tasks.clean_replication_agreement(self.master, self.replicas[1])
     result5 = self.master.run_command(
         ['ipa', 'topologysegment-find', DOMAIN_SUFFIX_NAME])
     num_entries = self.noentries_re.search(result5.stdout_text).group(1)
     assert (num_entries == "1"), "Incorrect number of entries displayed"