From ce8d4b781e1b227dd55cbcafbb8f75d018691c8b Mon Sep 17 00:00:00 2001 From: Nawaz Hussain Khazielakha Date: Thu, 12 Dec 2024 00:53:39 -0800 Subject: [PATCH] add e2e test for a default flavored template --- test/e2e/azure_test.go | 51 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index 0717dc1978a..9fc53783458 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -1154,7 +1154,56 @@ var _ = Describe("Workload cluster creation", func() { }) }) - Context("Creating a self-managed VM based cluster using API Server ILB feature gate [OPTIONAL][API-Server-ILB]", func() { + Context("Creating a self-managed VM based cluster using API Server ILB feature gate using default template [OPTIONAL][API-Server-ILB]", func() { + It("with three controlplane node and three worker nodes", func() { + clusterName = getClusterName(clusterNamePrefix, "apiserver-ilb") + + // Set the environment variables required for the API Server ILB feature gate + Expect(os.Setenv("EXP_APISERVER_ILB", "true")).To(Succeed()) + // Expect(os.Setenv("AZURE_INTERNAL_LB_PRIVATE_IP", "40.0.0.100")).To(Succeed()) + // Expect(os.Setenv("AZURE_VNET_CIDR", "40.0.0.0/8")).To(Succeed()) + // Expect(os.Setenv("AZURE_CP_SUBNET_CIDR", "40.0.0.0/16")).To(Succeed()) + // Expect(os.Setenv("AZURE_NODE_SUBNET_CIDR", "40.1.0.0/16")).To(Succeed()) + + clusterctl.ApplyClusterTemplateAndWait(ctx, createApplyClusterTemplateInput( + specName, + withNamespace(namespace.Name), + withClusterName(clusterName), + withControlPlaneMachineCount(3), + withWorkerMachineCount(2), + withControlPlaneInterval(specName, "wait-control-plane-ha"), + withControlPlaneWaiters(clusterctl.ControlPlaneWaiters{ + WaitForControlPlaneInitialized: EnsureControlPlaneInitializedNoAddons, + }), + withPostMachinesProvisioned(func() { + EnsureDaemonsets(ctx, func() DaemonsetsSpecInput { + return DaemonsetsSpecInput{ + BootstrapClusterProxy: bootstrapClusterProxy, + Namespace: namespace, + ClusterName: clusterName, + } + }) + }), + ), result) + + By("Probing workload cluster with APIServerILB feature gate", func() { + AzureAPIServerILBSpec(ctx, func() AzureAPIServerILBSpecInput { + return AzureAPIServerILBSpecInput{ + BootstrapClusterProxy: bootstrapClusterProxy, + Cluster: result.Cluster, + Namespace: namespace, + ClusterName: clusterName, + ExpectedWorkerNodes: result.ExpectedWorkerNodes(), + WaitIntervals: e2eConfig.GetIntervals(specName, "wait-worker-nodes"), + } + }) + }) + + By("PASSED!") + }) + }) + + Context("Creating a self-managed VM based cluster using API Server ILB feature gate and fully spec-ed out template [OPTIONAL][API-Server-ILB]", func() { It("with three controlplane node and three worker nodes", func() { clusterName = getClusterName(clusterNamePrefix, "apiserver-ilb")