Skip to content

Commit

Permalink
Add MariaDB to E2E (#10724)
Browse files Browse the repository at this point in the history
* add mariadb to Validate and Upgrade E2E tests

Signed-off-by: robertsilen <[email protected]>
Signed-off-by: Robert Silén <[email protected]>
Co-authored-by: Derek Nola <[email protected]>
  • Loading branch information
robertsilen and dereknola authored Sep 19, 2024
1 parent 7d66fa7 commit 40eda6a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
11 changes: 10 additions & 1 deletion tests/e2e/upgradecluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 12 additions & 2 deletions tests/e2e/validatecluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 40eda6a

Please sign in to comment.