Skip to content

Commit

Permalink
PRODENG-2574 Full Smoke test Upgrades products now (#453)
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dimitrov <[email protected]>
  • Loading branch information
cranzy authored Mar 19, 2024
1 parent 8d89387 commit dce33cb
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 70 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ smoke-small:

.PHONY: smoke-full
smoke-full:
go test -v ./test/smoke/... -run TestSupportedMatrixCluster -timeout 30m
go test -v ./test/smoke/... -run TestSupportedMatrixCluster -timeout 40m

.PHONY: clean-launchpad-chart
clean-launchpad-chart:
Expand Down
90 changes: 43 additions & 47 deletions examples/tf-aws/launchpad/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/tf-aws/launchpad/launchpad.tf
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ spec:
msr:
version: ${var.launchpad.msr_version}
imageRepo: docker.io/mirantis
"replicaIDs": "sequential"
installFlags:
- "--ucp-insecure-tls"
%{endif}
EOT

Expand Down
10 changes: 3 additions & 7 deletions examples/tf-aws/launchpad/provision.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ locals {
module "provision" {
source = "terraform-mirantis-modules/provision-aws/mirantis"

name = var.name
tags = local.tags
name = var.name
common_tags = local.tags
network = var.network

cidr = var.network.cidr
public_subnet_count = 1
private_subnet_count = 0
enable_vpn_gateway = false
enable_nat_gateway = false

// pass in a mix of nodegroups with the platform information
nodegroups = { for k, ngd in local.nodegroups_wplatform : k => {
Expand Down
5 changes: 5 additions & 0 deletions examples/tf-aws/launchpad/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// used to name infrastructure (CHANGE THIS)
name = "smoke-test"
aws = {
region = "us-east-1"
}

launchpad = {
drain = false
Expand All @@ -20,6 +23,8 @@ network = {
cidr = "172.31.0.0/16"
public_subnet_count = 3
private_subnet_count = 0 // if 0 then no private nodegroups allowed
enable_vpn_gateway = false
enable_nat_gateway = false
}

// one definition for each group of machines to include in the stack
Expand Down
4 changes: 4 additions & 0 deletions examples/tf-aws/launchpad/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ variable "network" {
cidr = string
public_subnet_count = number
private_subnet_count = number
enable_vpn_gateway = bool
enable_nat_gateway = bool
})
default = {
cidr = "172.31.0.0/16"
public_subnet_count = 3
private_subnet_count = 3
enable_vpn_gateway = false
enable_nat_gateway = false
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var AWS = map[string]interface{}{
"region": "eu-central-1",
"region": "us-east-1",
}

var MKE_CONNECT = map[string]interface{}{
Expand Down
30 changes: 21 additions & 9 deletions test/platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,48 +34,60 @@ func (p Platform) GetWorker() map[string]interface{} {
}
}

func (p Platform) GetMSR() map[string]interface{} {
return map[string]interface{}{
"platform": p.Name,
"count": p.Count,
"type": "m6a.2xlarge",
"volume_size": p.VolumeSize,
"public": p.Public,
"role": "msr",
"user_data": p.UserData,
}
}

var Platforms = map[string]Platform{
"Ubuntu20": {
Name: "ubuntu_20.04",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo ufw allow 7946/tcp ; sudo ufw allow 10250/tcp ",
},
"Ubuntu22": {
Name: "ubuntu_22.04",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo ufw allow 7946/tcp ; sudo ufw allow 10250/tcp ",
},
"Rhel9": {
Name: "rhel_9",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Rhel8": {
Name: "rhel_8",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Centos7": {
Name: "centos_7",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Oracle9": {
Name: "oracle_9",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Sles12": {
Name: "sles_12",
Expand All @@ -89,21 +101,21 @@ var Platforms = map[string]Platform{
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Rocky8": {
Name: "rocky_8",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Rocky9": {
Name: "rocky_9",
Count: 1,
VolumeSize: "100",
Public: true,
UserData: "",
UserData: "sudo firewall-cmd --zone=public --add-port=7946/tcp --permanent ; sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent ; sudo firewall-cmd --reload",
},
"Windows2019": {
Name: "windows_2019",
Expand Down
24 changes: 19 additions & 5 deletions test/smoke/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package smoke_test
import (
"fmt"
"log"
"strings"
"testing"

"github.com/Mirantis/mcc/pkg/config"
Expand All @@ -18,27 +19,30 @@ var AWS = map[string]interface{}{
var MKE_CONNECT = map[string]interface{}{
"username": "admin",
"password": "",
"insecure": false,
"insecure": true,
}

var LAUNCHPAD = map[string]interface{}{
"drain": false,
"mcr_version": "23.0.8",
"mcr_version": "23.0.7",
"mke_version": "3.7.3",
"msr_version": "",
"msr_version": "2.9.16",
"mke_connect": MKE_CONNECT,
}

// configure the network stack
var NETWORK = map[string]interface{}{
"cidr": "172.31.0.0/16",
"public_subnet_count": 3,
"public_subnet_count": 1,
"private_subnet_count": 0, // if 0 then no private nodegroups allowed
"enable_vpn_gateway": false,
"enable_nat_gateway": false,
}

// TestSmallCluster deploys a small test cluster
func TestSmallCluster(t *testing.T) {
log.Println("TestSmallCluster")

nodegroups := map[string]interface{}{
"MngrUbuntu22": test.Platforms["Ubuntu22"].GetManager(),
"WrkUbuntu22": test.Platforms["Ubuntu22"].GetWorker(),
Expand Down Expand Up @@ -93,6 +97,7 @@ func TestSmallCluster(t *testing.T) {
// TestSupportedMatrixCluster deploys a cluster with all supported platforms
func TestSupportedMatrixCluster(t *testing.T) {
log.Println("TestSupportedMatrixCluster")

nodegroups := map[string]interface{}{
"MngrUbuntu22": test.Platforms["Ubuntu22"].GetManager(),
"MngrRocky9": test.Platforms["Rocky9"].GetManager(),
Expand All @@ -105,7 +110,6 @@ func TestSupportedMatrixCluster(t *testing.T) {
"WrkSles15": test.Platforms["Sles15"].GetWorker(),
"WrkCentos7": test.Platforms["Centos7"].GetWorker(),
"WrkRhel9": test.Platforms["Rhel9"].GetWorker(),
"WrkOracle9": test.Platforms["Oracle9"].GetWorker(),
}

uTestId := test.GenerateRandomAlphaNumericString(5)
Expand Down Expand Up @@ -150,6 +154,16 @@ func TestSupportedMatrixCluster(t *testing.T) {
err = product.Apply(true, true, 3, true)
assert.NoError(t, err)

// Replace the version values for MCR,MKE,MSR in the mkeClusterConfig
mkeClusterConfig = strings.ReplaceAll(mkeClusterConfig, LAUNCHPAD["mcr_version"].(string), "23.0.9")
mkeClusterConfig = strings.ReplaceAll(mkeClusterConfig, LAUNCHPAD["mke_version"].(string), "3.7.5")

productUpgrade, err := config.ProductFromYAML([]byte(mkeClusterConfig))
assert.NoError(t, err)

err = productUpgrade.Apply(true, true, 3, true)
assert.NoError(t, err)

err = product.Reset()
assert.NoError(t, err)
}

0 comments on commit dce33cb

Please sign in to comment.