修复后端全量测试环境兼容问题

修正 Windows 本地回环 SFTP 测试的远程绝对路径映射,并避免在不支持 POSIX 权限位的环境中误判上传临时文件权限。后端全量测试和 go vet 已通过。
This commit is contained in:
xuans committed 2026-10-03 02:48:07 +08:00
1 parent e1f9b4d6f0
commit 857fb0e632
3 files changed
+22 -8

No files matched your search

@@ -4,6 +4,7 @@ import (
"context"
"errors"
"maps"
"path"
"path/filepath"
"reflect"
"testing"
@@ -12,9 +13,10 @@ import (
func recoveryPreflightFixture(roots ...string) (Server, *memoryClient, TransactionRecord) {
server := testServer("preflight").Normalize()
if len(roots) == 1 {
server.CertificatePath = filepath.ToSlash(filepath.Join(roots[0], "cert.pem"))
server.CertificateChainPath = filepath.ToSlash(filepath.Join(roots[0], "fullchain.pem"))
server.PrivateKeyPath = filepath.ToSlash(filepath.Join(roots[0], "key.pem"))
remoteRoot := "/" + filepath.ToSlash(roots[0])
server.CertificatePath = path.Join(remoteRoot, "cert.pem")
server.CertificateChainPath = path.Join(remoteRoot, "fullchain.pem")
server.PrivateKeyPath = path.Join(remoteRoot, "key.pem")
}
client := newMemoryClient()
r := TransactionRecord{