diff --git a/tests/e2e/upgradecluster/Vagrantfile b/tests/e2e/upgradecluster/Vagrantfile index 6c63fae9b5..1bb0adc04c 100644 --- a/tests/e2e/upgradecluster/Vagrantfile +++ b/tests/e2e/upgradecluster/Vagrantfile @@ -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" diff --git a/tests/e2e/validatecluster/Vagrantfile b/tests/e2e/validatecluster/Vagrantfile index 80d99d67af..d8e588096a 100644 --- a/tests/e2e/validatecluster/Vagrantfile +++ b/tests/e2e/validatecluster/Vagrantfile @@ -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"