Add MariaDB to E2E (#10724)

* add mariadb to Validate and Upgrade E2E tests

Signed-off-by: robertsilen <robert.silen@iki.fi>
Signed-off-by: Robert Silén <robert.silen@iki.fi>
Co-authored-by: Derek Nola <derek.nola@suse.com>
pull/10920/head
Robert Silén 2024-09-19 18:40:02 +03:00 committed by GitHub
parent 7d66fa7ffa
commit 40eda6a823
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 3 deletions

View File

@ -91,7 +91,16 @@ end
def getDBType(role, role_num, vm)
if EXTERNAL_DB == "mysql"
if EXTERNAL_DB == "mariadb"
if role.include?("server") && role_num == 0
dockerInstall(vm)
vm.provision "Start mariaDB", inline: "docker run -d -p 3306:3306 --name #{EXTERNAL_DB} -e MARIADB_ROOT_PASSWORD=e2e mariadb:11"
vm.provision "shell", inline: "echo \"Wait for mariaDB to startup\"; sleep 10"
return "datastore-endpoint: 'mysql://root:e2e@tcp(#{NETWORK_PREFIX}.100:3306)/k3s'"
elsif role.include?("server") && role_num != 0
return "datastore-endpoint: 'mysql://root:e2e@tcp(#{NETWORK_PREFIX}.100:3306)/k3s'"
end
elsif EXTERNAL_DB == "mysql"
if role.include?("server") && role_num == 0
dockerInstall(vm)
vm.provision "Start mysql", inline: "docker run -d -p 3306:3306 --name #{EXTERNAL_DB} -e MYSQL_ROOT_PASSWORD=e2e mysql:5.7"

View File

@ -99,8 +99,18 @@ def provision(vm, role, role_num, node_num)
end
def getDBType(role, role_num, vm)
if EXTERNAL_DB == "mysql"
if EXTERNAL_DB == "mariadb"
if role.include?("server") && role_num == 0
dockerInstall(vm)
vm.provision "Start mariaDB", inline: "docker run -d -p 3306:3306 --name #{EXTERNAL_DB} -e MARIADB_ROOT_PASSWORD=e2e mariadb:11"
vm.provision "shell", inline: "echo \"Wait for mariaDB to startup\"; sleep 10"
return "datastore-endpoint: 'mysql://root:e2e@tcp(#{NETWORK_PREFIX}.100:3306)/k3s'"
elsif role.include?("server") && role_num != 0
return "datastore-endpoint: 'mysql://root:e2e@tcp(#{NETWORK_PREFIX}.100:3306)/k3s'"
end
elsif EXTERNAL_DB == "mysql"
if role.include?("server") && role_num == 0
dockerInstall(vm)
vm.provision "Start mysql", inline: "docker run -d -p 3306:3306 --name #{EXTERNAL_DB} -e MYSQL_ROOT_PASSWORD=e2e mysql:5.7"