Add UT coverage to cluster refresh
Added a test that validate that refresh cluster ignore disabled hosts
@@ -514,6 +514,32 @@ var _ = Describe("Refresh Cluster - No DHCP", func() {
}),
errorExpected: false,
},
+ {
+ name: "insufficient to ready with disabled master",
+ srcState: models.ClusterStatusInsufficient,
+ dstState: models.ClusterStatusReady,
+ machineNetworkCidr: "1.2.3.0/24",
+ apiVip: "1.2.3.5",
+ ingressVip: "1.2.3.6",
+ hosts: []models.Host{
+ {ID: &hid1, Status: swag.String(models.HostStatusDisabled), Inventory: defaultInventory(), Role: models.HostRoleMaster},
+ {ID: &hid2, Status: swag.String(models.HostStatusKnown), Inventory: defaultInventory(), Role: models.HostRoleMaster},
+ {ID: &hid3, Status: swag.String(models.HostStatusKnown), Inventory: defaultInventory(), Role: models.HostRoleMaster},
+ {ID: &hid4, Status: swag.String(models.HostStatusKnown), Inventory: defaultInventory(), Role: models.HostRoleMaster},
+ },
+ statusInfoChecker: makeValueChecker(statusInfoReady),
+ validationsChecker: makeJsonChecker(map[validationID]validationCheckResult{
+ IsMachineCidrDefined: {status: ValidationSuccess, messagePattern: "Machine network CIDR is defined"},
+ isMachineCidrEqualsToCalculatedCidr: {status: ValidationSuccess, messagePattern: "Cluster machine CIDR equals to the calculated CIDR"},
+ isApiVipDefined: {status: ValidationSuccess, messagePattern: "API vip is defined"},
+ isApiVipValid: {status: ValidationSuccess, messagePattern: "belongs to machine CIDR and not in use"},
+ isIngressVipDefined: {status: ValidationSuccess, messagePattern: "Ingress vip is defined"},
+ isIngressVipValid: {status: ValidationSuccess, messagePattern: "belongs to machine CIDR and not in use"},
+ AllHostsAreReadyToInstall: {status: ValidationSuccess, messagePattern: "All hosts in the cluster are ready to install"},
+ SufficientMastersCount: {status: ValidationSuccess, messagePattern: "Cluster has sufficient number of master candidates"},
+ }),
+ errorExpected: false,
+ },
{
name: "insufficient to ready",
srcState: models.ClusterStatusInsufficient,
