[修复] 升级功能问题修复

This commit is contained in:
ryan
2026-03-12 19:16:20 +08:00
parent ae6d871046
commit 001f106b82
5 changed files with 137 additions and 17 deletions
+8
View File
@@ -5,6 +5,7 @@ import (
"bytes"
"context"
"os"
"path/filepath"
"runtime"
"testing"
"time"
@@ -174,6 +175,13 @@ func TestUploadManualServerBinary(t *testing.T) {
if candidate.UploadToken != info.UploadToken {
t.Fatalf("unexpected stored upload token: %s", candidate.UploadToken)
}
execPath, err := os.Executable()
if err != nil {
t.Fatalf("failed to get executable path: %v", err)
}
if filepath.Dir(candidate.TempPath) != filepath.Dir(execPath) {
t.Fatalf("expected temporary binary in executable dir, got %s want %s", filepath.Dir(candidate.TempPath), filepath.Dir(execPath))
}
}
func TestUploadManualServerBinaryRejectsSameVersion(t *testing.T) {