Fix MySQL MSI command arguments

This commit is contained in:
王鹏
2026-10-09 09:53:46 +08:00
parent 51cb348731
commit e744b002d3
2 changed files with 29 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ from deploy_tool.installer import (
MYSQL_INSTALLER_SHA256,
MYSQL_INSTALLER_URL,
build_mysql_installer_command,
build_windows_command_parameters,
configure_mysql_weak_password_policy,
default_mysql_install_log_path,
TOMCAT_VERSION,
@@ -125,6 +126,20 @@ class InstallerTests(unittest.TestCase):
self.assertEqual(MYSQL_INSTALLER_SHA256, "F60502EB1EE10A9C1D0A26706A627D224DFAE466D82EF3EB9D76A8A718DB9D80")
self.assertIn("downloads.mysql.com/archives/", MYSQL_INSTALLER_URL)
def test_formats_mysql_consoleargs_as_an_msi_property_value(self):
command = build_mysql_installer_command(
Path(r"C:\Temp Folder\mysql-installer.msi"),
Path(r"C:\Log Folder\mysql-install.log"),
)
parameters = build_windows_command_parameters(command)
self.assertIn('/i "C:\\Temp Folder\\mysql-installer.msi"', parameters)
self.assertIn('/L*V "C:\\Log Folder\\mysql-install.log"', parameters)
self.assertIn('CONSOLEARGS="install server;8.0.43;x64:*:', parameters)
self.assertIn('root_passwd=123456 --silent --auto-handle-prereqs"', parameters)
self.assertNotIn('"CONSOLEARGS=', parameters)
def test_mysql_is_not_installed_from_stale_winget_manifest(self):
with self.assertRaises(ValueError):
build_install_command("MySQL")