Skip to content

Commit

Permalink
test/e2e: add check at anti-affinity test to ensure enough hosts exist
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jul 7, 2023
1 parent 05acd30 commit 41ca90b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/e2e/anti_affinity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ func VerifyAntiAffinity(ctx context.Context, input AntiAffinitySpecInput) {
clusterName := fmt.Sprintf("anti-affinity-%s", util.RandomString(6))
Expect(namespace).NotTo(BeNil())

By("checking if the target system has enough hosts")
hostSystems, err := input.Finder.HostSystemList(ctx, "*")
Expect(err).ToNot(HaveOccurred())
Expect(len(hostSystems) > int(input.WorkerNodeCount)).To(BeTrue(), "This test requires more or equal number of hosts compared to WorkerNodeCount")

Byf("creating a workload cluster %s", clusterName)
configCluster := defaultConfigCluster(clusterName, namespace.Name, "", 1, input.WorkerNodeCount,
input.Global)
Expand Down

0 comments on commit 41ca90b

Please sign in to comment.