Skip to content

Commit 73926b6

Browse files
committed
lab: keep mobile test hardening network-neutral
1 parent d9f8aa7 commit 73926b6

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

scripts/harden_nuvio_mobile_device_test.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#!/usr/bin/env python3
2-
"""Harden a prepared NuvioMobile Android device-test workspace.
2+
"""Harden a prepared NuvioMobile Android device-test workspace for test execution only.
33
4-
The native lab preparation intentionally modifies a pinned upstream checkout.
5-
This helper keeps infrastructure-only Android requirements in one place:
6-
- resolve duplicate libc++_shared.so packaging in instrumentation APKs;
7-
- disable Sentry auto-init in the test process so no DSN is required;
8-
- enable host-served local_candidate HTTP only for the instrumentation APK.
9-
10-
It is idempotent and tolerant of whitespace changes in the prepared Gradle block.
4+
This helper may resolve build/test-process requirements (duplicate libc++ packaging and
5+
Sentry auto-init) but it must never relax playback/network policy. The human UX reader
6+
lab inherits the accepted Nuvio application's production transport conditions exactly.
117
"""
128
from __future__ import annotations
139

1410
import argparse
1511
import re
1612
from pathlib import Path
1713

18-
from configure_native_android_lab_transport import configure_manifest
14+
from configure_native_android_lab_transport import validate_manifest
1915

2016

2117
def harden(repo: Path) -> None:
@@ -62,14 +58,16 @@ def harden(repo: Path) -> None:
6258
''',
6359
encoding="utf-8",
6460
)
65-
configure_manifest(test_manifest)
61+
validate_manifest(test_manifest)
6662

6763
final = build.read_text(encoding="utf-8")
6864
if final.count(packaging_line) != 1:
6965
raise SystemExit(
7066
f"unexpected libc++ shared packaging rule count={final.count(packaging_line)}"
7167
)
72-
print("NuvioMobile device-test hardening applied")
68+
if "usesCleartextTraffic" in test_manifest.read_text(encoding="utf-8"):
69+
raise SystemExit("device-test hardening must not relax Android cleartext policy")
70+
print("NuvioMobile device-test build hardening applied; playback network policy unchanged")
7371

7472

7573
def main() -> int:

0 commit comments

Comments
 (0)