This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
forked from kubermatic/machine-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_e2e_test.go
550 lines (453 loc) · 20.3 KB
/
all_e2e_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
// +build e2e
/*
Copyright 2019 The Machine Controller Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package provisioning
import (
"flag"
"fmt"
"os"
"testing"
clusterv1alpha1 "github.com/kubermatic/machine-controller/pkg/apis/cluster/v1alpha1"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog"
)
func init() {
klog.InitFlags(nil)
if err := clusterv1alpha1.SchemeBuilder.AddToScheme(scheme.Scheme); err != nil {
klog.Fatalf("failed to add clusterv1alpha1 to scheme: %v", err)
}
}
const (
DOManifest = "./testdata/machinedeployment-digitalocean.yaml"
AWSManifest = "./testdata/machinedeployment-aws.yaml"
AWSEBSEncryptedManifest = "./testdata/machinedeployment-aws-ebs-encryption-enabled.yaml"
AzureManifest = "./testdata/machinedeployment-azure.yaml"
AzureRedhatSatelliteManifest = "./testdata/machinedeployment-azure.yaml"
GCEManifest = "./testdata/machinedeployment-gce.yaml"
HZManifest = "./testdata/machinedeployment-hetzner.yaml"
PacketManifest = "./testdata/machinedeployment-packet.yaml"
LinodeManifest = "./testdata/machinedeployment-linode.yaml"
VSPhereManifest = "./testdata/machinedeployment-vsphere.yaml"
VSPhereDSCManifest = "./testdata/machinedeployment-vsphere-datastore-cluster.yaml"
VSPhereResourcePoolManifest = "./testdata/machinedeployment-vsphere-resource-pool.yaml"
OSManifest = "./testdata/machinedeployment-openstack.yaml"
OSUpgradeManifest = "./testdata/machinedeployment-openstack-upgrade.yml"
invalidMachineManifest = "./testdata/machine-invalid.yaml"
kubevirtManifest = "./testdata/machinedeployment-kubevirt.yaml"
kubevirtManifestDNSConfig = "./testdata/machinedeployment-kubevirt-dns-config.yaml"
alibabaManifest = "./testdata/machinedeployment-alibaba.yaml"
)
var testRunIdentifier = flag.String("identifier", "local", "The unique identifier for this test run")
func TestInvalidObjectsGetRejected(t *testing.T) {
t.Parallel()
tests := []scenario{
{osName: "invalid", executor: verifyCreateMachineFails},
{osName: "coreos", executor: verifyCreateMachineFails},
}
for i, test := range tests {
testScenario(t,
test,
fmt.Sprintf("invalid-machine-%v", i),
nil,
invalidMachineManifest,
false)
}
}
func TestKubevirtProvisioningE2E(t *testing.T) {
t.Parallel()
kubevirtKubeconfig := os.Getenv("KUBEVIRT_E2E_TESTS_KUBECONFIG")
if kubevirtKubeconfig == "" {
t.Fatalf("Unable to run kubevirt tests, KUBEVIRT_E2E_TESTS_KUBECONFIG must be set")
}
selector := Not(OsSelector("sles", "flatcar", "rhel"))
params := []string{
fmt.Sprintf("<< KUBECONFIG >>=%s", kubevirtKubeconfig),
}
runScenarios(t, selector, params, kubevirtManifest, fmt.Sprintf("kubevirt-%s", *testRunIdentifier))
}
func TestKubevirtDNSConfigProvisioningE2E(t *testing.T) {
t.Parallel()
kubevirtKubeconfig := os.Getenv("KUBEVIRT_E2E_TESTS_KUBECONFIG")
if kubevirtKubeconfig == "" {
t.Fatalf("Unable to run kubevirt tests, KUBEVIRT_E2E_TESTS_KUBECONFIG must be set")
}
params := []string{
fmt.Sprintf("<< KUBECONFIG >>=%s", kubevirtKubeconfig),
}
scenario := scenario{
name: "Kubevirt with dns config",
osName: "ubuntu",
containerRuntime: "docker",
kubernetesVersion: "v1.17.0",
executor: verifyCreateAndDelete,
}
testScenario(t, scenario, *testRunIdentifier, params, kubevirtManifestDNSConfig, false)
}
func TestOpenstackProvisioningE2E(t *testing.T) {
t.Parallel()
osAuthURL := os.Getenv("OS_AUTH_URL")
osDomain := os.Getenv("OS_DOMAIN")
osPassword := os.Getenv("OS_PASSWORD")
osRegion := os.Getenv("OS_REGION")
osUsername := os.Getenv("OS_USERNAME")
osTenant := os.Getenv("OS_TENANT_NAME")
osNetwork := os.Getenv("OS_NETWORK_NAME")
if osAuthURL == "" || osUsername == "" || osPassword == "" || osDomain == "" || osRegion == "" || osTenant == "" {
t.Fatal("unable to run test suite, all of OS_AUTH_URL, OS_USERNAME, OS_PASSOWRD, OS_REGION, OS_TENANT and OS_DOMAIN must be set!")
}
params := []string{
fmt.Sprintf("<< IDENTITY_ENDPOINT >>=%s", osAuthURL),
fmt.Sprintf("<< USERNAME >>=%s", osUsername),
fmt.Sprintf("<< PASSWORD >>=%s", osPassword),
fmt.Sprintf("<< DOMAIN_NAME >>=%s", osDomain),
fmt.Sprintf("<< REGION >>=%s", osRegion),
fmt.Sprintf("<< TENANT_NAME >>=%s", osTenant),
fmt.Sprintf("<< NETWORK_NAME >>=%s", osNetwork),
}
selector := Not(OsSelector("sles", "rhel"))
runScenarios(t, selector, params, OSManifest, fmt.Sprintf("os-%s", *testRunIdentifier))
}
// TestDigitalOceanProvisioning - a test suite that exercises digital ocean provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
//
// note that tests require a valid API Token that is read from the DO_E2E_TEST_TOKEN environmental variable.
func TestDigitalOceanProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
doToken := os.Getenv("DO_E2E_TESTS_TOKEN")
if len(doToken) == 0 {
t.Fatal("unable to run the test suite, DO_E2E_TESTS_TOKEN environement varialbe cannot be empty")
}
selector := Not(OsSelector("sles", "rhel", "flatcar"))
// act
params := []string{fmt.Sprintf("<< DIGITALOCEAN_TOKEN >>=%s", doToken)}
runScenarios(t, selector, params, DOManifest, fmt.Sprintf("do-%s", *testRunIdentifier))
}
// TestAWSProvisioning - a test suite that exercises AWS provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestAWSProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
awsKeyID := os.Getenv("AWS_E2E_TESTS_KEY_ID")
awsSecret := os.Getenv("AWS_E2E_TESTS_SECRET")
if len(awsKeyID) == 0 || len(awsSecret) == 0 {
t.Fatal("unable to run the test suite, AWS_E2E_TESTS_KEY_ID or AWS_E2E_TESTS_SECRET environment variables cannot be empty")
}
selector := Not(OsSelector("sles"))
// act
params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
fmt.Sprintf("<< AWS_SECRET_ACCESS_KEY >>=%s", awsSecret),
}
runScenarios(t, selector, params, AWSManifest, fmt.Sprintf("aws-%s", *testRunIdentifier))
}
// TestAWSSLESProvisioningE2E - a test suite that exercises AWS provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestAWSSLESProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
awsKeyID := os.Getenv("AWS_E2E_TESTS_KEY_ID")
awsSecret := os.Getenv("AWS_E2E_TESTS_SECRET")
if len(awsKeyID) == 0 || len(awsSecret) == 0 {
t.Fatal("unable to run the test suite, AWS_E2E_TESTS_KEY_ID or AWS_E2E_TESTS_SECRET environment variables cannot be empty")
}
// act
params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
fmt.Sprintf("<< AWS_SECRET_ACCESS_KEY >>=%s", awsSecret),
}
// We would like to test SLES image only in this test as the other images are tested in TestAWSProvisioningE2E
selector := OsSelector("sles")
runScenarios(t, selector, params, AWSManifest, fmt.Sprintf("aws-%s", *testRunIdentifier))
}
func TestAWSCentOS8ProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
awsKeyID := os.Getenv("AWS_E2E_TESTS_KEY_ID")
awsSecret := os.Getenv("AWS_E2E_TESTS_SECRET")
if len(awsKeyID) == 0 || len(awsSecret) == 0 {
t.Fatal("unable to run the test suite, AWS_E2E_TESTS_KEY_ID or AWS_E2E_TESTS_SECRET environment variables cannot be empty")
}
amiID := "ami-032025b3afcbb6b34" // official "CentOS 8.2.2004 x86_64"
params := []string{
fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
fmt.Sprintf("<< AWS_SECRET_ACCESS_KEY >>=%s", awsSecret),
fmt.Sprintf("<< AMI >>=%s", amiID),
}
// We would like to test CentOS8 image only in this test as the other images are tested in TestAWSProvisioningE2E
selector := OsSelector("centos")
runScenarios(t, selector, params, AWSManifest, fmt.Sprintf("aws-%s", *testRunIdentifier))
}
// TestAWSProvisioningE2EWithEbsEncryptionEnabled - a test suite that exercises AWS provider with ebs encryption enabled
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestAWSProvisioningE2EWithEbsEncryptionEnabled(t *testing.T) {
t.Parallel()
// test data
awsKeyID := os.Getenv("AWS_E2E_TESTS_KEY_ID")
awsSecret := os.Getenv("AWS_E2E_TESTS_SECRET")
if len(awsKeyID) == 0 || len(awsSecret) == 0 {
t.Fatal("unable to run the test suite, AWS_E2E_TESTS_KEY_ID or AWS_E2E_TESTS_SECRET environment variables cannot be empty")
}
// act
params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
fmt.Sprintf("<< AWS_SECRET_ACCESS_KEY >>=%s", awsSecret),
}
scenario := scenario{
name: "AWS with ebs encryption enabled",
osName: "ubuntu",
containerRuntime: "docker",
kubernetesVersion: "v1.15.6",
executor: verifyCreateAndDelete,
}
testScenario(t, scenario, fmt.Sprintf("aws-%s", *testRunIdentifier), params, AWSEBSEncryptedManifest, false)
}
// TestAzureProvisioningE2E - a test suite that exercises Azure provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestAzureProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
azureTenantID := os.Getenv("AZURE_E2E_TESTS_TENANT_ID")
azureSubscriptionID := os.Getenv("AZURE_E2E_TESTS_SUBSCRIPTION_ID")
azureClientID := os.Getenv("AZURE_E2E_TESTS_CLIENT_ID")
azureClientSecret := os.Getenv("AZURE_E2E_TESTS_CLIENT_SECRET")
if len(azureTenantID) == 0 || len(azureSubscriptionID) == 0 || len(azureClientID) == 0 || len(azureClientSecret) == 0 {
t.Fatal("unable to run the test suite, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET environment variables cannot be empty")
}
selector := Not(OsSelector("sles"))
// act
params := []string{
fmt.Sprintf("<< AZURE_TENANT_ID >>=%s", azureTenantID),
fmt.Sprintf("<< AZURE_SUBSCRIPTION_ID >>=%s", azureSubscriptionID),
fmt.Sprintf("<< AZURE_CLIENT_ID >>=%s", azureClientID),
fmt.Sprintf("<< AZURE_CLIENT_SECRET >>=%s", azureClientSecret),
}
runScenarios(t, selector, params, AzureManifest, fmt.Sprintf("azure-%s", *testRunIdentifier))
}
// TestAzureRedhatSatelliteProvisioningE2E - a test suite that exercises Azure provider
// by requesting rhel node and subscribe to redhat satellite server.
func TestAzureRedhatSatelliteProvisioningE2E(t *testing.T) {
t.Parallel()
t.Skip()
// test data
azureTenantID := os.Getenv("AZURE_E2E_TESTS_TENANT_ID")
azureSubscriptionID := os.Getenv("AZURE_E2E_TESTS_SUBSCRIPTION_ID")
azureClientID := os.Getenv("AZURE_E2E_TESTS_CLIENT_ID")
azureClientSecret := os.Getenv("AZURE_E2E_TESTS_CLIENT_SECRET")
if len(azureTenantID) == 0 || len(azureSubscriptionID) == 0 || len(azureClientID) == 0 || len(azureClientSecret) == 0 {
t.Fatal("unable to run the test suite, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET environment variables cannot be empty")
}
// act
params := []string{
fmt.Sprintf("<< AZURE_TENANT_ID >>=%s", azureTenantID),
fmt.Sprintf("<< AZURE_SUBSCRIPTION_ID >>=%s", azureSubscriptionID),
fmt.Sprintf("<< AZURE_CLIENT_ID >>=%s", azureClientID),
fmt.Sprintf("<< AZURE_CLIENT_SECRET >>=%s", azureClientSecret),
}
scenario := scenario{
name: "Azure redhat satellite server subscription",
osName: "rhel",
containerRuntime: "docker",
kubernetesVersion: "v1.17.0",
executor: verifyCreateAndDelete,
}
testScenario(t, scenario, *testRunIdentifier, params, AzureRedhatSatelliteManifest, false)
}
// TestGCEProvisioningE2E - a test suite that exercises Google Cloud provider
// by requesting nodes with different combination of container runtime type,
// container runtime version and the OS flavour.
func TestGCEProvisioningE2E(t *testing.T) {
t.Parallel()
// Test data.
googleServiceAccount := os.Getenv("GOOGLE_SERVICE_ACCOUNT")
if len(googleServiceAccount) == 0 {
t.Fatal("unable to run the test suite, GOOGLE_SERVICE_ACCOUNT environment variable cannot be empty")
}
// Act. GCE does not support CentOS.
selector := OsSelector("ubuntu", "coreos")
params := []string{
fmt.Sprintf("<< GOOGLE_SERVICE_ACCOUNT >>=%s", googleServiceAccount),
}
runScenarios(t, selector, params, GCEManifest, fmt.Sprintf("gce-%s", *testRunIdentifier))
}
// TestHetznerProvisioning - a test suite that exercises Hetzner provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestHetznerProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
hzToken := os.Getenv("HZ_E2E_TOKEN")
if len(hzToken) == 0 {
t.Fatal("unable to run the test suite, HZ_E2E_TOKEN environment variable cannot be empty")
}
// Hetzner does not support coreos
selector := Not(OsSelector("coreos", "sles", "rhel", "flatcar"))
// act
params := []string{fmt.Sprintf("<< HETZNER_TOKEN >>=%s", hzToken)}
runScenarios(t, selector, params, HZManifest, fmt.Sprintf("hz-%s", *testRunIdentifier))
}
// TestPacketProvisioning - a test suite that exercises Packet provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestPacketProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
apiKey := os.Getenv("PACKET_API_KEY")
if len(apiKey) == 0 {
t.Fatal("unable to run the test suite, PACKET_API_KEY environment variable cannot be empty")
}
projectID := os.Getenv("PACKET_PROJECT_ID")
if len(projectID) == 0 {
t.Fatal("unable to run the test suite, PACKET_PROJECT_ID environment variable cannot be empty")
}
selector := Not(OsSelector("sles", "rhel"))
// act
params := []string{
fmt.Sprintf("<< PACKET_API_KEY >>=%s", apiKey),
fmt.Sprintf("<< PACKET_PROJECT_ID >>=%s", projectID),
}
runScenarios(t, selector, params, PacketManifest, fmt.Sprintf("packet-%s", *testRunIdentifier))
}
func TestAlibabaProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
accessKeyID := os.Getenv("ALIBABA_ACCESS_KEY_ID")
if len(accessKeyID) == 0 {
t.Fatal("unable to run the test suite, ALIBABA_ACCESS_KEY_ID environment variable cannot be empty")
}
accessKeySecret := os.Getenv("ALIBABA_ACCESS_KEY_SECRET")
if len(accessKeySecret) == 0 {
t.Fatal("unable to run the test suite, ALIBABA_ACCESS_KEY_SECRET environment variable cannot be empty")
}
selector := Not(OsSelector("coreos", "sles", "rhel", "flatcar"))
// act
params := []string{
fmt.Sprintf("<< ALIBABA_ACCESS_KEY_ID >>=%s", accessKeyID),
fmt.Sprintf("<< ALIBABA_ACCESS_KEY_SECRET >>=%s", accessKeySecret),
}
runScenarios(t, selector, params, alibabaManifest, fmt.Sprintf("alibaba-%s", *testRunIdentifier))
}
// TestLinodeProvisioning - a test suite that exercises Linode provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
//
// note that tests require a valid API Token that is read from the LINODE_E2E_TEST_TOKEN environmental variable.
func TestLinodeProvisioningE2E(t *testing.T) {
t.Parallel()
// test data
linodeToken := os.Getenv("LINODE_E2E_TESTS_TOKEN")
if len(linodeToken) == 0 {
t.Fatal("unable to run the test suite, LINODE_E2E_TESTS_TOKEN environment variable cannot be empty")
}
// we're shimming userdata through Linode stackscripts, and Linode's coreos does not support stackscripts
// and the stackscript hasn't been verified for use with centos
selector := OsSelector("ubuntu")
// act
params := []string{fmt.Sprintf("<< LINODE_TOKEN >>=%s", linodeToken)}
runScenarios(t, selector, params, LinodeManifest, fmt.Sprintf("linode-%s", *testRunIdentifier))
}
func getVSphereTestParams(t *testing.T) []string {
// test data
vsPassword := os.Getenv("VSPHERE_E2E_PASSWORD")
vsUsername := os.Getenv("VSPHERE_E2E_USERNAME")
vsCluster := os.Getenv("VSPHERE_E2E_CLUSTER")
vsAddress := os.Getenv("VSPHERE_E2E_ADDRESS")
if vsPassword == "" || vsUsername == "" || vsAddress == "" || vsCluster == "" {
t.Fatal("unable to run the test suite, VSPHERE_E2E_PASSWORD, VSPHERE_E2E_USERNAME, VSPHERE_E2E_CLUSTER " +
"or VSPHERE_E2E_ADDRESS environment variables cannot be empty")
}
// act
params := []string{fmt.Sprintf("<< VSPHERE_PASSWORD >>=%s", vsPassword),
fmt.Sprintf("<< VSPHERE_USERNAME >>=%s", vsUsername),
fmt.Sprintf("<< VSPHERE_ADDRESS >>=%s", vsAddress),
fmt.Sprintf("<< VSPHERE_CLUSTER >>=%s", vsCluster),
}
return params
}
// TestVsphereProvisioning - a test suite that exercises vsphere provider
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestVsphereProvisioningE2E(t *testing.T) {
t.Parallel()
selector := Not(OsSelector("sles", "rhel"))
params := getVSphereTestParams(t)
runScenarios(t, selector, params, VSPhereManifest, fmt.Sprintf("vs-%s", *testRunIdentifier))
}
// TestVsphereDatastoreClusterProvisioning - is the same as the TestVsphereProvisioning suite but specifies a DatastoreCluster
// instead of the Datastore in the provider specs.
func TestVsphereDatastoreClusterProvisioningE2E(t *testing.T) {
t.Parallel()
selector := Not(OsSelector("sles", "rhel", "flatcar", "rhel"))
params := getVSphereTestParams(t)
runScenarios(t, selector, params, VSPhereDSCManifest, fmt.Sprintf("vs-dsc-%s", *testRunIdentifier))
}
// TestVsphereResourcePoolProvisioning - creates a machine deployment using a
// resource pool.
func TestVsphereResourcePoolProvisioningE2E(t *testing.T) {
t.Parallel()
params := getVSphereTestParams(t)
// We do not need to test all combinations.
scenario := scenario{
name: "vSphere resource pool provisioning",
osName: "coreos",
containerRuntime: "docker",
kubernetesVersion: "1.17.0",
executor: verifyCreateAndDelete,
}
testScenario(t, scenario, *testRunIdentifier, params, VSPhereResourcePoolManifest, false)
}
// TestUbuntuProvisioningWithUpgradeE2E will create an instance from an old Ubuntu 1604
// image and upgrade it prior to joining the cluster
func TestUbuntuProvisioningWithUpgradeE2E(t *testing.T) {
t.Parallel()
osAuthURL := os.Getenv("OS_AUTH_URL")
osDomain := os.Getenv("OS_DOMAIN")
osPassword := os.Getenv("OS_PASSWORD")
osRegion := os.Getenv("OS_REGION")
osUsername := os.Getenv("OS_USERNAME")
osTenant := os.Getenv("OS_TENANT_NAME")
osNetwork := os.Getenv("OS_NETWORK_NAME")
if osAuthURL == "" || osUsername == "" || osPassword == "" || osDomain == "" || osRegion == "" || osTenant == "" {
t.Fatal("unable to run test, all of OS_AUTH_URL, OS_USERNAME, OS_PASSOWRD, OS_REGION, OS_TENANT and OS_DOMAIN must be set!")
}
params := []string{
fmt.Sprintf("<< IDENTITY_ENDPOINT >>=%s", osAuthURL),
fmt.Sprintf("<< USERNAME >>=%s", osUsername),
fmt.Sprintf("<< PASSWORD >>=%s", osPassword),
fmt.Sprintf("<< DOMAIN_NAME >>=%s", osDomain),
fmt.Sprintf("<< REGION >>=%s", osRegion),
fmt.Sprintf("<< TENANT_NAME >>=%s", osTenant),
fmt.Sprintf("<< NETWORK_NAME >>=%s", osNetwork),
}
scenario := scenario{
name: "Ubuntu upgrade",
osName: "ubuntu",
containerRuntime: "docker",
kubernetesVersion: "1.16.2",
executor: verifyCreateAndDelete,
}
testScenario(t, scenario, *testRunIdentifier, params, OSUpgradeManifest, false)
}
// TestDeploymentControllerUpgradesMachineE2E verifies the machineDeployment controller correctly
// rolls over machines on changes in the machineDeployment
func TestDeploymentControllerUpgradesMachineE2E(t *testing.T) {
t.Parallel()
// test data
hzToken := os.Getenv("HZ_E2E_TOKEN")
if len(hzToken) == 0 {
t.Fatal("unable to run the test suite, HZ_E2E_TOKEN environment variable cannot be empty")
}
// act
params := []string{fmt.Sprintf("<< HETZNER_TOKEN >>=%s", hzToken)}
scenario := scenario{
name: "MachineDeployment upgrade",
osName: "ubuntu",
containerRuntime: "docker",
kubernetesVersion: "1.16.2",
executor: verifyCreateUpdateAndDelete,
}
testScenario(t, scenario, *testRunIdentifier, params, HZManifest, false)
}