?>Array ( [id] => 135 ) Testing Failure Condition: Attempting to Add a Controller to an Existing HA Cluster - WeAreCAS
builtins addNode

Testing Failure Condition: Attempting to Add a Controller to an Existing HA Cluster

Scénario de test & Cas d'usage

Contexte Métier

An administrator, unaware that the CAS cluster is already configured for high availability (with a primary and a backup controller), attempts to add another controller. This test validates the system's ability to prevent an invalid topology.
Préparation des Données

Simulate a CAS environment that is already in a high-availability state, with one primary and one backup controller.

Copié !
1/* Initial state: 1 primary controller, 1 backup controller. */

Étapes de réalisation

1
Confirm the existing HA configuration by checking the server status.
Copié !
1PROC CAS;
2 BUILTINS.serverStatus;
3RUN;
2
Attempt to add a third controller, which is an invalid operation.
Copié !
1PROC CAS;
2 BUILTINS.addNode /
3 node={"cascontroller03.example.com"},
4 role="CONTROLLER";
5RUN;

Résultat Attendu


The `addNode` action must fail. The CAS log should produce a clear and specific error message indicating that a backup controller already exists and a third controller cannot be added. A subsequent check of the server status should show that the cluster topology remains unchanged (still one primary and one backup controller).