* Copyright (c) Huawei Technologies Co., Ltd. 2026-2026. All rights reserved.
* ubs-engine is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
#ifndef IT_ELECTION_CASES_H
#define IT_ELECTION_CASES_H
#include <cstdint>
#include <string>
#include <vector>
#include "it_cluster.h"
namespace ubse::it::tests::election {
struct ElectionRoles {
uint32_t masterCount{0};
uint32_t standbyCount{0};
uint32_t agentCount{0};
std::string masterNodeId;
std::string standbyNodeId;
std::vector<std::string> agentNodeIds;
};
ElectionRoles CollectElectionRoles(ubse::it::infra::ItCluster& cluster);
void RunSingleNodeElectionTest(ubse::it::infra::ItCluster& cluster);
void RunTwoNodeElectionTest(ubse::it::infra::ItCluster& cluster);
void RunTwoNodeElectionCandidateFalseTest(ubse::it::infra::ItCluster& cluster);
void RunFourNodeElectionTest(ubse::it::infra::ItCluster& cluster);
void RunFourNodeMasterRestartTest(ubse::it::infra::ItCluster& cluster);
}
#endif