mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix: stop starting a session on the slow proot (#1395)
This commit is contained in:
1 parent
5d945d7784
commit
d65912f0c5
14 files changed
+169
-16
No files matched your search
+11
-1
@@ -10,7 +10,7 @@
|
||||
# 5. on a foldable cycles the device state (half-opened, and with --closed also closed) through
|
||||
# `cmd device_state`, then puts the original state back;
|
||||
# 6. reads the newest session folder of a debug build: first frame, last frame rate, the
|
||||
# memory page size and the last process exits.
|
||||
# memory page size, the proot that session ran, and the last process exits.
|
||||
#
|
||||
# Usage: tools/device-smoke.sh [--serial SERIAL] [--apk FILE] [--pkg PACKAGE]
|
||||
# [--no-density] [--no-size] [--no-fold] [--closed]
|
||||
@@ -279,6 +279,16 @@ else
|
||||
ev=$(sh_ run-as "$pkg" cat "files/logs/$dir/events.jsonl" 2>/dev/null)
|
||||
echo "$ev" | grep -q '"frame.first"' && ok "first frame was drawn" || note "no frame.first in $dir"
|
||||
echo "$ev" | grep -q '"session.failed"' && bad "session.failed: $(echo "$ev" | grep '"session.failed"' | tail -1 | cut -c1-160)"
|
||||
report=$(sh_ run-as "$pkg" cat "files/logs/$dir/device.txt" 2>/dev/null)
|
||||
proot_line=$(echo "$report" | grep 'proot binary' | head -1)
|
||||
case $proot_line in
|
||||
*"rootfs fallback"*|*"missing"*) bad "session proot is not the patched binary ($proot_line)" ;;
|
||||
*"apk"*|*"add-on pack"*) ok "patched proot ($proot_line)" ;;
|
||||
*) note "device report has no proot binary line (build from before the check)" ;;
|
||||
esac
|
||||
app_log=$(sh_ run-as "$pkg" cat "files/logs/$dir/app.log" 2>/dev/null)
|
||||
echo "$app_log" | grep -Fq 'proot: fast path on (' && ok "proot fast path was on" \
|
||||
|| note "proot fast path activation was not recorded ($(echo "$report" | grep 'proot fast path' | tr '\n' '; '))"
|
||||
fps=$(sh_ run-as "$pkg" cat "files/logs/$dir/app.log" 2>/dev/null | grep 'last 10 s:' | tail -1 | sed 's/.*last 10 s: //' | cut -c1-70)
|
||||
[ -n "$fps" ] && echo " last stats $fps"
|
||||
sh_ run-as "$pkg" cat "files/logs/$dir/device.txt" 2>/dev/null | grep -E 'Memory page size|^Kernel' | sed 's/^/ report /'
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Published proot pack for a build that did not compile libproot.so into the APK.
|
||||
# CI builds embed the binary and publish their own pack; this pin is what a source
|
||||
# build downloads. Tag on DroidDeck-Components: pack-proot-<first 16 hex of the digest>.
|
||||
# Update both lines when source builds should pick up a newer proot.
|
||||
PROOT_PACK_SHA256=5a2b7284e6357f88a14a790abd54e61effbe5f202c63b6aaba9b974c559649c3
|
||||
PROOT_PACK_SIZE=96643
|
||||
@@ -47,6 +47,8 @@ elif a[:1] == ["shell"]:
|
||||
s.setdefault("log_commands", []).append(a)
|
||||
p.write_text(json.dumps(s))
|
||||
if "ls" in a: print(s["session"])
|
||||
elif a[-1].endswith("/device.txt"): print(s.get("report", ""))
|
||||
elif a[-1].endswith("/app.log"): print(s.get("app_log", ""))
|
||||
else: print("package not debuggable")
|
||||
'''
|
||||
|
||||
@@ -112,6 +114,16 @@ class DeviceSmokeTest(unittest.TestCase):
|
||||
self.assertEqual(1, result.returncode, result.stdout)
|
||||
self.assertIn("could not launch", result.stdout)
|
||||
|
||||
def test_fast_path_requires_a_session_activation_log(self):
|
||||
for active in (False, True):
|
||||
with self.subTest(active=active):
|
||||
result, _ = self.run_smoke(
|
||||
session="session", report="proot fast path (eligible) true",
|
||||
app_log="proot: fast path on (66 binds)" if active else "proot: fast path off - too many binds",
|
||||
)
|
||||
self.assertEqual(0, result.returncode, result.stdout + result.stderr)
|
||||
self.assertEqual(active, "PASS proot fast path was on" in result.stdout)
|
||||
|
||||
def test_session_name_remains_one_remote_argument(self):
|
||||
session = "x';id;#"
|
||||
result, state = self.run_smoke(session=session)
|
||||
|
||||
Reference in new issue
Block a user