Fix fixture mouse integration and capture clean USB-tablet baseline
This commit is contained in:
1 parent
6ccaaae3c7
commit
90d6b05f4d
10 files changed
+424
-43
No files matched your search
@@ -84,6 +84,43 @@ func TestNativeFixtureAssets_HP_HARNESS_20(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Static safety contracts complement the live Windows device/GUI checks.
|
||||
func TestMouseFilterRecoveryAssets_HP_HARNESS_21(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.Fatal(err)
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
host := read("scripts/windows/test-host")
|
||||
for _, required := range []string{"mouse-status|mouse-verify|mouse-bypass|mouse-restore", "mouse_action=Restore; assert_provisioner_elevated", "mouse-filter-backup.json", "step \"$action completed; inspect reboot_required before testing input\"", "prepare-usb-mouse-verified", "assert_mouse_bypassed()", "Never reboot here"} {
|
||||
if !strings.Contains(host, required) {
|
||||
t.Fatalf("mouse recovery controller is missing %q", required)
|
||||
}
|
||||
}
|
||||
filter := read("scripts/windows/mouse-filter.ps1")
|
||||
for _, required := range []string{"$Action = 'Status'", "[IO.FileMode]::CreateNew", "-PropertyType MultiString", "$filters -notcontains 'mouclass'", "VID_80EE&PID_0021", "refusing to overwrite other changes", "/restart-device $device.InstanceId", "$deviceExit -eq 3010", "reboot_required=$rebootRequired", "RVBOX_GUEST_OK"} {
|
||||
if !strings.Contains(filter, required) {
|
||||
t.Fatalf("mouse filter helper is missing safety contract %q", required)
|
||||
}
|
||||
}
|
||||
for _, prohibited := range []string{"shutdown.exe", "/delete-driver", "Remove-ItemProperty", "Stop-Service", "/force"} {
|
||||
if strings.Contains(filter, prohibited) {
|
||||
t.Fatalf("mouse filter helper contains prohibited automatic/destructive action %q", prohibited)
|
||||
}
|
||||
}
|
||||
probe := read("test/rdp-access/mouse-probe.py")
|
||||
for _, required := range []string{"Session 0", "range(10)", "GetAsyncKeyState(1)", "'dialog_result'", "time.monotonic() + 600"} {
|
||||
if !strings.Contains(probe, required) {
|
||||
t.Fatalf("interactive mouse probe is missing %q", required)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestProductionComposeAssets_HP_OPS_01 guards the deployment properties that
|
||||
// a syntax-only Compose check cannot prove: private server reachability through
|
||||
// nginx, non-root state initialization, and a repository-local smoke cleanup.
|
||||
|
||||
Reference in new issue
Block a user