APK wrapper registers platform=android via AETHERFORGE_PLATFORM; fleet UI shows robot icons, Android Access Depth probes, and a shortened mining onion timeline.
35 lines
959 B
Go
35 lines
959 B
Go
package config
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
)
|
|
|
|
func TestRegistrationPlatformDefault(t *testing.T) {
|
|
t.Setenv("AETHERFORGE_PLATFORM", "")
|
|
if got := RegistrationPlatform(); got != runtime.GOOS {
|
|
t.Fatalf("RegistrationPlatform() = %q want %q", got, runtime.GOOS)
|
|
}
|
|
if IsAndroidPlatform() {
|
|
t.Fatal("IsAndroidPlatform() true without override")
|
|
}
|
|
}
|
|
|
|
func TestRegistrationPlatformFromEnv(t *testing.T) {
|
|
t.Setenv("AETHERFORGE_PLATFORM", "android")
|
|
if got := RegistrationPlatform(); got != "android" {
|
|
t.Fatalf("RegistrationPlatform() = %q want android", got)
|
|
}
|
|
if !IsAndroidPlatform() {
|
|
t.Fatal("IsAndroidPlatform() false with AETHERFORGE_PLATFORM=android")
|
|
}
|
|
}
|
|
|
|
func TestRegistrationPlatformApkMode(t *testing.T) {
|
|
t.Setenv("AETHERFORGE_PLATFORM", "")
|
|
cfg := RuntimeConfig{BuiltinConfig: BuiltinConfig{ApkMode: true}}
|
|
if got := cfg.RegistrationPlatform(); got != "android" {
|
|
t.Fatalf("RegistrationPlatform() = %q want android", got)
|
|
}
|
|
}
|