Jump to: navigation, search

V4/Manage replication topology/Test plan

Name: V4/Manage replication topology/Test plan
Target version: TODO
Design: V4/Manage_replication_topology
Reviewer: Incomplete.png missing
Last updated: 2016-09-12 by Ofayans

Overview

The goal of this feature is to provide a consistent information about the replication topology on each server. It is achieved by maintaining the replication topology information in the shared LDAP tree. The new feature allows to manage replication agreements via a set of standard ipa commands and therefore deprecates a number of use-cases of ipa-replica-manage command. Namely, it obsoletes 'connect' and 'disconnect' subcommands. Each replication agreement is referenced as a Topology Segment. User can add and remove topology segments via ipa topology* subcommands and via web interface in the Topology section. The topology graph is visualized in the aforementioned section of IPA WebUI.

Test Plan

Test case: Replication Topology is listed among directory server plugins

Autotest

ipatests/test_ipaserver/test_topology_plugin.py:TestTopologyPlugin

Setup

Setup a FreeIPA server

Actions

  1. Run the command on the server:
     $ ldapsearch -D "cn=Directory Manager" -w '<directory_manager_password>' -b "cn=IPA Topology Configuration,cn=plugins,cn=config" 

Expected results

  1. The query should return the corresponding record with the following params:
nsslapd-pluginEnabled: on 
nsslapd-pluginPath: libtopology 
objectClass: nsSlapdPlugin 
objectClass: extensibleObject 
nsslapd-plugin-depends-on-named: Multimaster Replication Plugin 

Test case: Replication topology should be saved in the LDAP tree

Autotest

{{{autotest}}}

Setup

Setup a FreeIPA server

Actions

  1. Run the command on the server:
     ldapsearch -LLL -D "cn=Directory Manager" -w '<directory_manager_password>' -b "cn=topology,cn=ipa,cn=etc,dc=example,dc=com" 
  2. Prepare and install a replica, repeat the last ldap command on the server
  3. Issue the same command on the replica

Expected results

  1. The query should return 2 records:
    dn: cn=topology,cn=ipa,cn=etc,dc=example,dc=com dn: cn=realm,cn=topology,cn=ipa,cn=etc,dc=example,dc=com
  2. The query should return 3 results. The last one should describe the replication agreement:
    dn: cn=replica.example.com-to-master.example.com,cn=realm,cn=topology,cn=ipa,cn=etc,dc=example,dc=com
  3. Replica must have records identical to the ones on master

Test case: The plugin should only be active when domain level is 1 or higher

Autotest

{{{autotest}}}

Setup

  1. Setup a master with domain level 0
    ipa-server-install --setup-dns --forwarder=<forwarder_ip> --domain-level 0
  2. Setup a replica using the "old" workflow: prepare a gpg replica file on master, copy it to replica, run ipa-replica-install [options] path_to_replica_file

Actions

  1. Run the command on the server:
    ipa domainlevel-get
  2. Issue the following command on the master
    ipa topologysegment-find realm
  3. Run the command on the server:
    ipa domainlevel-set 1
  4. Repeat step 2

Expected results

  1. The value is "0"
  2. It should show zero segments
  3. The step should succeed
  4. It should show 1 segment:
    Segment name: master.example.com-to-replica1.example.com

Test case: CLI options test

Autotest

{{{autotest}}}

Setup

Actions

  1. Issue the following command on the freshly installed ipa:
    ipa help topology
  2. Issue the following command on the freshly installed ipa:
for i in `ipa help topology | awk '/^\s*topologys/ {print $1}'` ; do ipa help $i ; done | grep Usage | wc -l

Expected results

  1. The help message with the following options should be displayed:
    topologysegment-add
    topologysegment-del
    topologysegment-find
    topologysegment-mod
    topologysegment-reinitialize
    topologysegment-show
    topologysuffix-find
    topologysuffix-show
    topologysuffix-verify
  2. The result should be 9, corresponding to the amount of the topology-related commands

Test case: Basic CRUD test

Autotest

ipatests/test_integration/test_topology.py:test_add_remove_segment

Setup

  1. setup a star topology of 1 master and 2 replicas with domain level 1

Actions

  1. list all segments:
    ipa topologysegment-find realm
  2. add a segment connecting the two replicas directly:
    ipa topologysegment-add realm replica1-to-replica2 --leftnode=replica1.example.com --rightnode=replica2.example.com 
  3. repeat step 1
  4. delete a segment connecting replica2 with master:
    pa topologysegment-del realm master.example.com-to-replica2.example.com
  5. repeat step 1

Expected results

  1. Should return 2 segments:
    master - replica1
    master - replica2
  2. Command should succeed
  3. Should return 3 segments:
    master - replica1
    master - replica2
    replica1 - replica2
  4. Command should succeed
  5. Should return 2 segments:
    master - replica1
    replica1 - replica2


Test case: Removal of a topology segment is allowed only if there is at least one more segment connecting the given replica

Autotest

ipatests/test_integration/test_topology.py:test_remove_the_only_connection

Setup

  1. Setup a line topology:
    master <=> replica1 <=> replica2
  2. make sure the topology plugin is initialized:
    ipa domainlevel-get
    should return 1

Actions

  1. On the replica2 issue the following command:
    ipa topologysegment-find
  2. On the replica2 issue the following command:
    ipa topologysegment-del
    and, when asked for a segment name, enter
    replica1.example.com-to-replica2.example.com
  3. On amy of the replicas issue the command:
    ipa topologysegment-add realm master-to-replica2 --leftnode master.example.com --rightnode replica2.example.com
  4. Repeat step 2
  5. Repeat step 1

Expected results

  1. should return something like
    Suffix name: realm
    2 segments matched
      Segment name: replica1.example.com-to-replica2.example.com 
      Left node: replica1.example.com 
      Right node: replica2.example.com 
      Connectivity: both 
      Segment name: replica1.example.com-to-master.example.com 
      Left node: replica1.example.com 
      Right node: master.example.com 
      Connectivity: both 
    Number of entries returned 2 
  2. The command should not succeed and the error message should be displayed:
    ipa: ERROR: Server is unwilling to perform: Removal of Segment disconnects topology.Deletion not allowed.
  3. The command should succeed
  4. The step should succeed
  5. The output should show 2 segments:
    master.example.com-to-replica1.example.com
    master-to-replica2

Test case: Topology plugin should be disabled on FreeIPA upgrade from version 4.1

Autotest

{{{autotest}}}

Setup

  1. Setup a master host with FreeIPA version 4.1

Actions

  1. Upgrade the software on master to 4.2
  2. issue the command on master:
    ipa domainlevel-get
  3. prepare a replica file and copy it to a fresh vm. Setup a replica on this vm, using FreeIPA v 4.2 or above
  4. issue the command on replica:
    ipa domainlevel-get
  5. issue the command on master:
    ipa topologysegment-find realm

Expected results

  1. Action should succeed
  2. Should display
    Current domain level: 0
  3. Action should succeed
  4. Should display
    Current domain level: 0
  5. Should display
    0 segments matched
    Number of entries returned 0