diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt index 235b94d98..652589fe9 100644 --- a/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt @@ -63,6 +63,12 @@ class NativeGuestTest { assertEquals(null, NativeGuest.hostLinkTarget("/bare/mount", linkRoot, binds)) } + @Test + fun aSiblingOfAMountIsNotPartOfIt() { + assertEquals(null, NativeGuest.hostLinkTarget("/mnt/droiddeck-sdx", linkRoot, sdBinds)) + assertEquals("$linkRoot/opt/droiddeck-sdx", NativeGuest.hostLinkTarget("/opt/droiddeck-sdx", linkRoot, sdBinds + "/real/opt:/opt/droiddeck-sd")) + } + @Test fun aMountInsideAnIdentityMountStillMapsItsPaths() { val binds = listOf("/odd/place", "/real/sd:/odd/place/sd") diff --git a/tools/droiddeckctl b/tools/droiddeckctl index cc5b33e54..fa7adac19 100755 --- a/tools/droiddeckctl +++ b/tools/droiddeckctl @@ -785,7 +785,14 @@ def execute(args: argparse.Namespace, adb: str, serial: str) -> dict: argv = args.argv[1:] if args.argv[:1] == ["--"] else args.argv if not argv: raise ControlError("native needs a command after --", "INVALID_ARGUMENTS") - env = dict(item.partition("=")[::2] for item in args.env or []) + if not 0 < args.timeout <= 600: + raise ControlError("--timeout must be more than 0 and at most 600 seconds", "INVALID_ARGUMENTS") + env = {} + for item in args.env or []: + key, sep, value = item.partition("=") + if not sep: + raise ControlError(f"--env takes KEY=VALUE, not {item}", "INVALID_ARGUMENTS") + env[key] = value request = {"argv": argv, "timeout": args.timeout, "env": env} if args.cwd: request["cwd"] = args.cwd