Skip to content

Commit 8ce033d

Browse files
committed
Allow to specific flavor and custom root disk in e2e test
Signed-off-by: Fabian Ruff <[email protected]>
1 parent 750e19c commit 8ce033d

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
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)

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)