Skip to content

Commit e834444

Browse files
author
Cecile Robert-Michon
committed
Add more tests to CAPI tests
1 parent 6e02ece commit e834444

File tree

12 files changed

+60
-25
lines changed

12 files changed

+60
-25
lines changed

templates/test/dev/cluster-template-v1alpha4.yaml

Whitespace-only changes.

test/e2e/azure_logcollector.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ func linuxLogs(execToPathFn func(outputFileName string, command string, args ...
231231
"cloud-init-output.log",
232232
"cat", "/var/log/cloud-init-output.log",
233233
),
234+
execToPathFn(
235+
"sentinel-file-dir.txt",
236+
"ls", "/run/cluster-api/",
237+
),
234238
}
235239
}
236240

test/e2e/capi_test.go

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
. "github.com/onsi/gomega"
2828

2929
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
30-
"sigs.k8s.io/cluster-api/test/framework"
3130
"sigs.k8s.io/cluster-api/util"
3231
)
3332

@@ -83,6 +82,20 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
8382
})
8483
})
8584

85+
Context("Running the KCP upgrade spec in a HA cluster using scale in rollout", func() {
86+
capi_e2e.KCPUpgradeSpec(context.TODO(), func() capi_e2e.KCPUpgradeSpecInput {
87+
return capi_e2e.KCPUpgradeSpecInput{
88+
E2EConfig: e2eConfig,
89+
ClusterctlConfigPath: clusterctlConfigPath,
90+
BootstrapClusterProxy: bootstrapClusterProxy,
91+
ArtifactFolder: artifactFolder,
92+
ControlPlaneMachineCount: 3,
93+
SkipCleanup: skipCleanup,
94+
Flavor: "kcp-scale-in",
95+
}
96+
})
97+
})
98+
8699
Context("Running the MachineDeployment upgrade spec", func() {
87100
capi_e2e.MachineDeploymentUpgradesSpec(context.TODO(), func() capi_e2e.MachineDeploymentUpgradesSpecInput {
88101
return capi_e2e.MachineDeploymentUpgradesSpecInput{
@@ -126,7 +139,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
126139
return capi_e2e.KCPAdoptionSpecInput{
127140
E2EConfig: e2eConfig,
128141
ClusterctlConfigPath: clusterctlConfigPath,
129-
BootstrapClusterProxy: bootstrapClusterProxy.(framework.ClusterProxy),
142+
BootstrapClusterProxy: bootstrapClusterProxy,
130143
ArtifactFolder: artifactFolder,
131144
SkipCleanup: skipCleanup,
132145
}
@@ -138,7 +151,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
138151
return capi_e2e.MachinePoolInput{
139152
E2EConfig: e2eConfig,
140153
ClusterctlConfigPath: clusterctlConfigPath,
141-
BootstrapClusterProxy: bootstrapClusterProxy.(framework.ClusterProxy),
154+
BootstrapClusterProxy: bootstrapClusterProxy,
142155
ArtifactFolder: artifactFolder,
143156
SkipCleanup: skipCleanup,
144157
}
@@ -150,22 +163,23 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
150163
return capi_e2e.MachineDeploymentScaleSpecInput{
151164
E2EConfig: e2eConfig,
152165
ClusterctlConfigPath: clusterctlConfigPath,
153-
BootstrapClusterProxy: bootstrapClusterProxy.(framework.ClusterProxy),
166+
BootstrapClusterProxy: bootstrapClusterProxy,
154167
ArtifactFolder: artifactFolder,
155168
SkipCleanup: skipCleanup,
156169
}
157170
})
158171
})
159172

160-
Context("Should successfully set and use node drain timeout", func() {
161-
capi_e2e.NodeDrainTimeoutSpec(context.TODO(), func() capi_e2e.NodeDrainTimeoutSpecInput {
162-
return capi_e2e.NodeDrainTimeoutSpecInput{
163-
E2EConfig: e2eConfig,
164-
ClusterctlConfigPath: clusterctlConfigPath,
165-
BootstrapClusterProxy: bootstrapClusterProxy.(framework.ClusterProxy),
166-
ArtifactFolder: artifactFolder,
167-
SkipCleanup: skipCleanup,
168-
}
169-
})
170-
})
173+
// TODO: enable this with a longer timeout once https://github.com/kubernetes-sigs/cluster-api/pull/4830 is imported.
174+
//Context("Should successfully set and use node drain timeout", func() {
175+
// capi_e2e.NodeDrainTimeoutSpec(context.TODO(), func() capi_e2e.NodeDrainTimeoutSpecInput {
176+
// return capi_e2e.NodeDrainTimeoutSpecInput{
177+
// E2EConfig: e2eConfig,
178+
// ClusterctlConfigPath: clusterctlConfigPath,
179+
// BootstrapClusterProxy: bootstrapClusterProxy,
180+
// ArtifactFolder: artifactFolder,
181+
// SkipCleanup: skipCleanup,
182+
// }
183+
// })
184+
//})
171185
})

test/e2e/config/azure-dev.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ providers:
6868
targetName: "cluster-template-kcp-remediation.yaml"
6969
- sourcePath: "../data/infrastructure-azure/v1alpha4/cluster-template-kcp-scale-in.yaml"
7070
targetName: "cluster-template-kcp-scale-in.yaml"
71+
- sourcePath: "../data/infrastructure-azure/v1alpha4/cluster-template-node-drain.yaml"
72+
targetName: "cluster-template-node-drain.yaml"
7173
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-machine-pool.yaml"
7274
targetName: "cluster-template-machine-pool.yaml"
7375
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-nvidia-gpu.yaml"
@@ -108,6 +110,7 @@ variables:
108110
CONFORMANCE_NODES: "${CONFORMANCE_NODES:-1}"
109111
IP_FAMILY: "IPv4" # this is used by the CAPI quickstart spec
110112
MULTI_TENANCY_IDENTITY_NAME: "multi-tenancy-identity"
113+
NODE_DRAIN_TIMEOUT: "60s"
111114

112115
intervals:
113116
default/wait-controllers: ["3m", "10s"]
@@ -118,6 +121,7 @@ intervals:
118121
default/wait-machine-upgrade: ["60m", "10s"]
119122
default/wait-machine-remediation: ["30m", "10s"]
120123
default/wait-deployment: ["15m", "10s"]
124+
default/wait-deployment-available: ["15m", "10s"]
121125
default/wait-job: ["5m", "10s"]
122126
default/wait-service: ["5m", "10s"]
123127
default/wait-machine-pool-nodes: ["30m", "10s"]

test/e2e/data/infrastructure-azure/v1alpha4/bases/cluster-with-kcp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ spec:
120120
- contentFrom:
121121
secret:
122122
key: control-plane-azure.json
123-
name: ${CLUSTER_NAME}-control-plane-0-azure-json
123+
name: ${CLUSTER_NAME}-control-plane-azure-json
124124
owner: root:root
125125
path: /etc/kubernetes/azure.json
126126
permissions: "0644"

test/e2e/data/infrastructure-azure/v1alpha4/cluster-template-kcp-adoption/step1/cluster-with-cp0.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ spec:
1111
location: ${AZURE_LOCATION}
1212
networkSpec:
1313
vnet:
14-
name: ${CLUSTER_NAME}-vnet
15-
resourceGroup: ${CLUSTER_NAME}
14+
name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet}
15+
resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
1616
subscriptionID: ${AZURE_SUBSCRIPTION_ID}
1717
---
1818
# Cluster object with

test/e2e/data/infrastructure-azure/v1alpha4/cluster-template-kcp-adoption/step1/kustomization.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ commonLabels:
44
bases:
55
- cluster-with-cp0.yaml
66
- ../../bases/crs.yaml
7-
8-
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
kind: KubeadmControlPlane
2+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
3+
metadata:
4+
name: "${CLUSTER_NAME}-control-plane"
5+
spec:
6+
kubeadmConfigSpec:
7+
files:
8+
- contentFrom:
9+
secret:
10+
key: control-plane-azure.json
11+
name: ${CLUSTER_NAME}-control-plane-0-azure-json
12+
owner: root:root
13+
path: /etc/kubernetes/azure.json
14+
permissions: "0644"

test/e2e/data/infrastructure-azure/v1alpha4/cluster-template-kcp-adoption/step2/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ commonLabels:
44
bases:
55
- ../../bases/cluster-with-kcp.yaml
66

7+
patchesStrategicMerge:
8+
- ./cluster-with-kcp.yaml

test/e2e/data/infrastructure-azure/v1alpha4/cluster-template-kcp-scale-in/cluster-with-kcp.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# KubeadmControlPlane referenced by the Cluster object with
21
kind: KubeadmControlPlane
32
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
43
metadata:

0 commit comments

Comments
 (0)