Skip to content

Commit 759c85f

Browse files
committed
feat: a few steps further
1 parent 4bd80b8 commit 759c85f

File tree

4 files changed

+52
-23
lines changed

4 files changed

+52
-23
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ test-e2e: manifests generate fmt vet
138138
FIREWALL_IMAGE=$(E2E_FIREWALL_IMAGE) \
139139
FIREWALL_SIZE=$(E2E_FIREWALL_SIZE) \
140140
FIREWALL_NETWORKS=$(E2E_FIREWALL_NETWORKS) \
141-
go test ./test/e2e/frmwrk
141+
go test ./test/e2e/frmwrk -v ginkgo -vv
142142

143143
.PHONY: lint
144144
lint: golangci-lint ## Run golangci-lint linter

test/e2e/frmwrk/bootstrap_test.go

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"context"
55

66
. "github.com/onsi/ginkgo/v2"
7-
// . "github.com/onsi/gomega"
7+
. "github.com/onsi/gomega"
88

9-
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10-
controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1"
9+
// v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10+
// controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1"
1111
"sigs.k8s.io/cluster-api/test/framework"
1212
)
1313

@@ -33,8 +33,8 @@ var _ = Describe("Basic Cluster Creation", Ordered, func() {
3333

3434
ec := e2eCtx.NewE2ECluster(ClusterConfig{
3535
SpecName: "basic-cluster-creation",
36-
NamespaceName: "random",
37-
ClusterName: "random",
36+
NamespaceName: "simple",
37+
ClusterName: "simple",
3838
KubernetesVersion: "v1.34.1",
3939
ControlPlaneIP: "203.0.113.130",
4040
ControlPlaneMachineCount: 1,
@@ -47,27 +47,44 @@ var _ = Describe("Basic Cluster Creation", Ordered, func() {
4747
ec.GenerateAndApplyClusterTemplate(ctx)
4848

4949
By("Wait for cluster")
50-
framework.DiscoveryAndWaitForCluster(ctx, framework.DiscoveryAndWaitForClusterInput{
50+
cluster := framework.DiscoveryAndWaitForCluster(ctx, framework.DiscoveryAndWaitForClusterInput{
5151
Namespace: ec.NamespaceName,
5252
Name: ec.ClusterName,
5353
Getter: e2eCtx.Environment.Bootstrap.GetClient(),
54-
})
54+
}, e2eCtx.E2EConfig.GetIntervals("default", "wait-cluster")...)
5555

56-
framework.WaitForControlPlaneToBeReady(ctx, framework.WaitForControlPlaneToBeReadyInput{
57-
Getter: e2eCtx.Environment.Bootstrap.GetClient(),
58-
ControlPlane: &controlplanev1.KubeadmControlPlane{
59-
ObjectMeta: v1.ObjectMeta{
60-
Name: ec.ClusterName,
61-
Namespace: ec.NamespaceName,
62-
},
63-
},
56+
controlPlane := framework.GetKubeadmControlPlaneByCluster(ctx, framework.GetKubeadmControlPlaneByClusterInput{
57+
Lister: e2eCtx.Environment.Bootstrap.GetClient(),
58+
ClusterName: cluster.Name,
59+
Namespace: cluster.Namespace,
6460
})
6561

62+
Expect(controlPlane).To(Not(BeNil()))
63+
64+
// framework.WaitForKubeadmControlPlaneMachinesToExist(ctx, framework.WaitForKubeadmControlPlaneMachinesToExistInput{
65+
// Lister: e2eCtx.Environment.Bootstrap.GetClient(),
66+
// Cluster: cluster,
67+
// ControlPlane: controlPlane,
68+
// }, e2eCtx.E2EConfig.GetIntervals("default", "wait-control-plane")...)
69+
// framework.DiscoveryAndWaitForControlPlaneInitialized(ctx, framework.DiscoveryAndWaitForControlPlaneInitializedInput{
70+
// Lister: e2eCtx.Environment.Bootstrap.GetClient(),
71+
// Cluster: cluster,
72+
// }, e2eCtx.E2EConfig.GetIntervals("default", "wait-control-plane")...)
73+
74+
// By("Wait for control plane")
75+
// framework.WaitForControlPlaneToBeReady(ctx, framework.WaitForControlPlaneToBeReadyInput{
76+
// Getter: e2eCtx.Environment.Bootstrap.GetClient(),
77+
// ControlPlane: &controlplanev1.KubeadmControlPlane{
78+
// ObjectMeta: v1.ObjectMeta{
79+
// Name: ec.ClusterName,
80+
// Namespace: ec.NamespaceName,
81+
// },
82+
// },
83+
// }, e2eCtx.E2EConfig.GetIntervals("default", "wait-control-plane")...)
84+
6685
})
6786

6887
AfterAll(func() {
69-
if e2eCtx.Environment.ClusterProvider != nil {
70-
e2eCtx.Environment.ClusterProvider.Dispose(context.TODO())
71-
}
88+
e2eCtx.Teardown(context.TODO())
7289
})
7390
})

test/e2e/frmwrk/config/capi-e2e-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,18 @@ variables:
130130
WORKER_MACHINE_SIZE: "c1-medium-x86"
131131
CONTROL_PLANE_MACHINE_COUNT: "1"
132132
WORKER_MACHINE_COUNT: "1"
133+
134+
intervals:
135+
default/wait-controllers: ["4m", "10s"]
136+
default/wait-cluster: ["5m", "10s"]
137+
default/wait-control-plane: ["10m", "10s"]
138+
default/wait-worker-nodes: ["5m", "10s"]
139+
default/wait-machine-pool-nodes: ["5m", "10s"]
140+
default/wait-delete-cluster: ["3m", "10s"]
141+
default/wait-machine-upgrade: ["20m", "10s"]
142+
default/wait-control-plane-upgrade: ["15m", "10s"]
143+
default/wait-machine-deployment-upgrade: ["10m", "10s"]
144+
default/wait-machine-pool-upgrade: ["5m", "10s"]
145+
default/wait-nodes-ready: ["10m", "10s"]
146+
default/wait-machine-remediation: ["5m", "10s"]
147+
default/wait-autoscaler: ["5m", "10s"]

test/e2e/frmwrk/shared.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ func withDefaultEnvironment() Option {
9595
Expect(err).ToNot(HaveOccurred(), "failed to create metal client")
9696
e2e.Environment.Metal = mclient
9797

98-
fmt.Println("METAL_API_URL", e2e.envOrVar("METAL_API_URL"))
99-
fmt.Println("METAL_API_HMAC", e2e.envOrVar("METAL_API_HMAC"))
100-
fmt.Println("METAL_API_HMAC_AUTH_TYPE", e2e.envOrVar("METAL_API_HMAC_AUTH_TYPE"))
101-
10298
e2e.Environment.project = e2e.envOrVar("METAL_PROJECT_ID")
10399
e2e.Environment.partition = e2e.envOrVar("METAL_PARTITION")
104100
e2e.Environment.publicNetwork = e2e.envOrVar("METAL_PUBLIC_NETWORK")
@@ -409,6 +405,7 @@ func (e2e *E2ECluster) setupFirewall(ctx context.Context) {
409405
Protocol: "TCP",
410406
From: []string{"0.0.0.0/0"},
411407
To: []string{"0.0.0.0/0"},
408+
Ports: []int32{80, 443},
412409
},
413410
},
414411
},

0 commit comments

Comments
 (0)