Skip to content

Commit ba31cf8

Browse files
authored
Allow to specific flavor and custom root disk in e2e test (#1025)
* Allow to specific flavor and custom root disk in e2e test Signed-off-by: Fabian Ruff <fabian.ruff@sap.com> * Add pipeline hob for manually triggering kvm e2e tests Signed-off-by: Fabian Ruff <fabian.ruff@sap.com> --------- Signed-off-by: Fabian Ruff <fabian.ruff@sap.com>
1 parent 636f9b0 commit ba31cf8

File tree

3 files changed

+47
-9
lines changed

3 files changed

+47
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ build-e2e:
141141
.PHONY: test-e2e
142142
test-e2e:
143143
ifdef KS_PASSWORD
144-
export OS_PASSWORD=$(KS_PASSWORD)
144+
@export OS_PASSWORD=$(KS_PASSWORD)
145145
endif
146146
ifndef KUBERNIKUS_URL
147147
$(error set KUBERNIKUS_URL)

ci/pipeline.yaml.erb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,30 @@ jobs:
510510
<% end %>
511511
<% end %>
512512
<% end %>
513-
513+
- name: e2e-kvm
514+
serial: true
515+
build_logs_to_retain: 168
516+
plan:
517+
- in_parallel:
518+
- get: kubernikus.builds
519+
resource: kubernikus.git
520+
#- get: hourly
521+
# trigger: true
522+
- task: e2e_tests
523+
config:
524+
<<: *task_e2e_tests
525+
timeout: 45m
526+
params:
527+
<<: *auth_e2e_eu-de-2
528+
OS_AUTH_URL: https://identity-3.eu-de-2.cloud.sap/v3
529+
OS_PROJECT_NAME: kvm-kubernikus-e2e
530+
OS_PROJECT_DOMAIN_NAME: monsoon3
531+
KLUSTER_OS_IMAGES: flatcar-stable-amd64-kvm
532+
NODEPOOL_AVZ: eu-de-2a
533+
KLUSTER_FLAVOR: c_k_c2_m2_v2
534+
KLUSTER_CUSTOM_ROOT_DISK_SIZE: 64
535+
ISOLATE_TEST: true #not sure what this actually does
536+
KLUSTER_VERSION: <%= YAML::load(File.read(File.expand_path('../../charts/images.yaml', __FILE__)))["imagesForVersion"].keys.sort_by { |v| Gem::Version.new(v) }.max %>
514537
groups:
515538
- name: deploy
516539
jobs:
@@ -544,6 +567,7 @@ groups:
544567
- cli
545568
- whitesource
546569
- all-versions
570+
- e2e-kvm
547571
<% VERSIONS.each do |version| %>
548572
- e2e-<%= version %>
549573
<% end %>

test/e2e/setup_test.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"fmt"
55
"os"
6+
"strconv"
67
"strings"
78
"testing"
89
"time"
@@ -58,15 +59,28 @@ func (s *SetupTests) CreateCluster(t *testing.T) {
5859
}
5960
require.LessOrEqual(t, len(osImages), SmokeTestNodeCount, "more os images then smoke test node specified")
6061

62+
flavor := "c_c2_m2"
63+
if os.Getenv("KLUSTER_FLAVOR") != "" {
64+
flavor = os.Getenv("KLUSTER_FLAVOR")
65+
}
66+
customRootDiskSize := 0 // no custom root disk size by default
67+
if os.Getenv("KLUSTER_CUSTOM_ROOT_DISK_SIZE") != "" {
68+
var err error
69+
customRootDiskSize, err = strconv.Atoi(os.Getenv("KLUSTER_CUSTOM_ROOT_DISK_SIZE"))
70+
require.NoError(t, err, "KLUSTER_CUSTOM_ROOT_DISK_SIZE must be a valid integer")
71+
require.Greater(t, customRootDiskSize, 0, "KLUSTER_CUSTOM_ROOT_DISK_SIZE must be greater than 0")
72+
}
73+
6174
pools := []models.NodePool{}
6275
for i, image := range osImages {
6376
pools = append(pools, models.NodePool{
64-
Name: fmt.Sprintf("pool%d", i+1),
65-
Flavor: "c_c2_m2",
66-
Size: 1,
67-
AvailabilityZone: os.Getenv("NODEPOOL_AVZ"),
68-
Image: image,
69-
Labels: []string{"image=" + image},
77+
Name: fmt.Sprintf("pool%d", i+1),
78+
Flavor: flavor,
79+
Size: 1,
80+
AvailabilityZone: os.Getenv("NODEPOOL_AVZ"),
81+
Image: image,
82+
Labels: []string{"image=" + image},
83+
CustomRootDiskSize: int64(customRootDiskSize),
7084
})
7185
}
7286
//we fill up the first pool in case the number of images is smaller then the smoke test node count
@@ -76,7 +90,7 @@ func (s *SetupTests) CreateCluster(t *testing.T) {
7690
Name: s.KlusterName,
7791
Spec: models.KlusterSpec{
7892
Version: version,
79-
SSHPublicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXIxVEUgtUVkvk2VM1hmIb8MxvxsmvYoiq9OBy3J8akTGNybqKsA2uhcwxSJX5Cn3si8kfMfka9EWiJT+e1ybvtsGILO5XRZPxyhYzexwb3TcALwc3LuzpF3Z/Dg2jYTRELTGhYmyca3mxzTlCjNXvYayLNedjJ8fIBzoCuSXNqDRToHru7h0Glz+wtuE74mNkOiXSvhtuJtJs7VCNVjobFQNfC1aeDsri2bPRHJJZJ0QF4LLYSayMEz3lVwIDyAviQR2Aa97WfuXiofiAemfGqiH47Kq6b8X7j3bOYGBvJKMUV7XeWhGsskAmTsvvnFxkc5PAD3Ct+liULjiQWlzDrmpTE8aMqLK4l0YQw7/8iRVz6gli42iEc2ZG56ob1ErpTLAKFWyCNOebZuGoygdEQaGTIIunAncXg5Rz07TdPl0Tf5ZZLpiAgR5ck0H1SETnjDTZ/S83CiVZWJgmCpu8YOKWyYRD4orWwdnA77L4+ixeojLIhEoNL8KlBgsP9Twx+fFMWLfxMmiuX+yksM6Hu+Lsm+Ao7Q284VPp36EB1rxP1JM7HCiEOEm50Jb6hNKjgN4aoLhG5yg+GnDhwCZqUwcRJo1bWtm3QvRA+rzrGZkId4EY3cyOK5QnYV5+24x93Ex0UspHMn7HGsHUESsVeV0fLqlfXyd2RbHTmDMP6w== Kubernikus Master Key",
93+
SSHPublicKey: os.Getenv("KLUSTER_SSH_PUBLIC_KEY"),
8094
ClusterCIDR: &clusterCidr,
8195
NodePools: pools,
8296
Openstack: models.OpenstackSpec{

0 commit comments

Comments
 (0)