feat: add native Windows hierarchy test harness
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package windowsnative
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestNativeFixtureAssets_HP_HARNESS_20 prevents the host-side controller from
|
||||
// drifting back to a PowerShell-only or protocol-stub lane. It intentionally
|
||||
// checks only static contracts; the real hierarchy proof remains the documented
|
||||
// native VM run.
|
||||
func TestNativeFixtureAssets_HP_HARNESS_20(t *testing.T) {
|
||||
t.Parallel()
|
||||
root := filepath.Clean(filepath.Join("..", ".."))
|
||||
read := func(relative string) string {
|
||||
t.Helper()
|
||||
data, err := os.ReadFile(filepath.Join(root, relative))
|
||||
if err != nil {
|
||||
t.Fatalf("read %s: %v", relative, err)
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
runner := read("scripts/windows/native-test")
|
||||
for _, required := range []string{
|
||||
"scripts/windows/build-test-bundle\" --native-fixture",
|
||||
"scripts/windows/test-host\" prepare",
|
||||
"ACTIVE_USER_ELEVATED,ACTIVE_SYSTEM",
|
||||
"assert_context local-service no local-service",
|
||||
"clean --purge --yes",
|
||||
"RVBOX_NATIVE_ENDPOINT_HOST",
|
||||
"test/linux-server/compose.yaml",
|
||||
} {
|
||||
if !strings.Contains(runner, required) {
|
||||
t.Fatalf("native runner is missing %q", required)
|
||||
}
|
||||
}
|
||||
testHost := read("scripts/windows/test-host")
|
||||
for _, required := range []string{"xz -T0 -3", "accelerated_stage", "copy_stage_file", "--proxy", "--anyauth", "--continue-at", "rvbox.exe.xz", "retry_limit=4", "ConnectTimeout=10", "bundle transfer did not reach the expected SHA-256 manifest", "verified transfer_sha256"} {
|
||||
if !strings.Contains(testHost, required) {
|
||||
t.Fatalf("native test-host is missing compressed transfer contract %q", required)
|
||||
}
|
||||
}
|
||||
compose := read("test/linux-server/compose.yaml")
|
||||
for _, required := range []string{"../../bin/rvbox-server", "nginx:1.27-alpine", "rvbox.native.run_id", "RVBOX_NATIVE_RUNTIME_DIR"} {
|
||||
if !strings.Contains(compose, required) {
|
||||
t.Fatalf("native Compose fixture is missing %q", required)
|
||||
}
|
||||
}
|
||||
defaults := read("internal/client/supervisor/windows/testfaults_default.go")
|
||||
fixture := read("internal/client/supervisor/windows/testfaults_fixture.go")
|
||||
if !strings.Contains(defaults, "//go:build !rvbox_native_test") || !strings.Contains(fixture, "//go:build rvbox_native_test") {
|
||||
t.Fatal("fixture-only context faults are not separated from release builds")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user