Add fleet ops dashboard, Calibrate enforcement, and dead-code cleanup.
Ship live alerts, pool status, AI monitor, remote agent commands, build manager, and uninstall flow; wire Calibrate settings (WS ping, pool traffic log, retention limits) at runtime and exclude server/data from git.
This commit is contained in:
50
server/internal/builder/uninstall_test.go
Normal file
50
server/internal/builder/uninstall_test.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package builder
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGenerateUninstallScriptContainsPersistenceKey(t *testing.T) {
|
||||
req := &BuildRequest{
|
||||
WorkerName: "office-pc",
|
||||
ProcessName: "RuntimeHelper",
|
||||
StealthMode: false,
|
||||
InstallBase: "localappdata",
|
||||
}
|
||||
script := generateUninstallScript("abc12345-uuid", req)
|
||||
if !strings.Contains(script, "CryptoMiner-office-pc") {
|
||||
t.Fatalf("expected normal persistence key in script, got: %s", script)
|
||||
}
|
||||
if !strings.Contains(script, "RuntimeHelper") {
|
||||
t.Fatal("expected process name in script")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateUninstallScriptStealthKey(t *testing.T) {
|
||||
req := &BuildRequest{
|
||||
WorkerName: "office-pc",
|
||||
ProcessName: "RuntimeHelper",
|
||||
StealthMode: true,
|
||||
}
|
||||
script := generateUninstallScript("abc12345-uuid", req)
|
||||
if !strings.Contains(script, "RuntimeHelper") {
|
||||
t.Fatalf("expected stealth persistence key to match process name")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateUninstallScriptInstallPathTokens(t *testing.T) {
|
||||
req := &BuildRequest{
|
||||
WorkerName: "office-pc",
|
||||
ProcessName: "RuntimeHelper",
|
||||
InstallBase: "localappdata",
|
||||
InstallRelativePath: "CryptoMiner/{worker}-{build_short}",
|
||||
}
|
||||
script := generateUninstallScript("abc12345-uuid", req)
|
||||
if !strings.Contains(script, "office-pc-abc12345") {
|
||||
t.Fatalf("expected expanded install relative path in script, got fragment missing")
|
||||
}
|
||||
if !strings.Contains(script, "$env:LOCALAPPDATA") {
|
||||
t.Fatal("expected LOCALAPPDATA base in script")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user