Improve controller behavior and update project requirements
This commit is contained in:
@@ -18,7 +18,7 @@ import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
from remote_support import connect, execute
|
||||
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent / "测试设备登记"))
|
||||
from prepare_test_device import check_connected, load_registration
|
||||
@@ -259,8 +259,10 @@ def wifi_snapshot(client, fields: dict) -> dict:
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--adb", type=Path, required=True)
|
||||
parser.add_argument("--build", type=Path, required=True)
|
||||
parser.add_argument("--adb", type=Path)
|
||||
parser.add_argument("--list-scenarios", action="store_true")
|
||||
parser.add_argument("--dry-run", action="store_true")
|
||||
parser.add_argument("--build", type=Path)
|
||||
parser.add_argument("--resume", action="store_true", help="Continue after the saved recovery profile is active on the computer hotspot")
|
||||
parser.add_argument("--root-swipe", action="store_true", help="Requires explicit root permission for scrolling only the foreground App settings list")
|
||||
parser.add_argument("--skip-wrong", action="store_true", help="Use only when the wrong-password branch has been separately observed and archived")
|
||||
@@ -268,6 +270,19 @@ def main() -> int:
|
||||
parser.add_argument("--validate-only", action="store_true", help="Verify form and invalid IPv4 without switching networks")
|
||||
parser.add_argument("--final-check", action="store_true", help="Verify App, BLE, board, and recovery cleanup on the original network")
|
||||
args = parser.parse_args()
|
||||
modes = ['validate_only', 'wrong_only', 'skip_wrong', 'final_check']
|
||||
if args.list_scenarios:
|
||||
print('validate-only: form only; wrong-only: failed activation with timed restore; skip-wrong: cross-network DHCP/static roundtrip; final-check: restored state checks')
|
||||
return 0
|
||||
selected = [m for m in modes if getattr(args, m)]
|
||||
if len(selected) != 1: parser.error('Select exactly one explicit WiFi mode')
|
||||
if args.resume and not args.skip_wrong: parser.error('--resume requires --skip-wrong')
|
||||
if args.dry_run:
|
||||
print(json.dumps({'scenario': selected[0], 'root_phone': True, 'board': True, 'network_change': selected[0] in ('wrong_only', 'skip_wrong')}))
|
||||
return 0
|
||||
if not args.adb or not args.build: parser.error('--adb and --build required')
|
||||
global connect, execute
|
||||
from remote_support import connect, execute
|
||||
args.root_swipe = True
|
||||
if not (args.wrong_only or args.skip_wrong or args.resume or args.validate_only or args.final_check):
|
||||
raise RuntimeError("请选择 --validate-only、--wrong-only、--final-check 或已完成错误密码单测后的 --skip-wrong")
|
||||
|
||||
Reference in New Issue
Block a user