mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-05-11 23:59:41 +08:00
- SSH 缓存 key 纳入认证指纹(password/keyPath),避免改错凭证仍复用旧连接/端口转发 - MySQL/MariaDB/Doris:SSH 隧道建立失败直接返回错误,不再回退直连导致测试误判成功 - 新增最小单测覆盖 SSH cache key 与 UseSSH 异常路径 - build-release.sh:create-dmg 使用 staging 目录作为 source,避免 DMG 根目录变成 Contents - refs #213
27 lines
529 B
Go
27 lines
529 B
Go
package db
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"GoNavi-Wails/internal/connection"
|
|
)
|
|
|
|
func TestMySQLDSN_UseSSH_ShouldFailWhenSSHInvalid(t *testing.T) {
|
|
m := &MySQLDB{}
|
|
_, err := m.getDSN(connection.ConnectionConfig{
|
|
Host: "127.0.0.1",
|
|
Port: 3306,
|
|
User: "root",
|
|
UseSSH: true,
|
|
SSH: connection.SSHConfig{
|
|
Host: "127.0.0.1",
|
|
Port: 0, // invalid port, should fail immediately
|
|
User: "bad",
|
|
Password: "bad",
|
|
},
|
|
})
|
|
if err == nil {
|
|
t.Fatalf("expected error when UseSSH=true and SSH config invalid")
|
|
}
|
|
}
|