From 2f298bcb21a273fcfd862a7c48f285f4918ac6e9 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Thu, 29 Feb 2024 19:41:24 +0800 Subject: [PATCH] adb-remount-test: Adb shell command could return 0 or 255 if device is disconnected Background: aosp/I25f740bd222263fcb3c501def38977db6af1e0d9 Bug: 327552188 Test: abtd Change-Id: Ida33bfa00887e8ac358e057fc37fd45095ccc26b --- fs_mgr/tests/adb-remount-test.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs_mgr/tests/adb-remount-test.sh b/fs_mgr/tests/adb-remount-test.sh index 7ac7a1642..526c761d3 100755 --- a/fs_mgr/tests/adb-remount-test.sh +++ b/fs_mgr/tests/adb-remount-test.sh @@ -1081,7 +1081,9 @@ LOG OK "no overlay present before setup" LOG RUN "Testing adb disable-verity -R" T=$(adb_date) -adb_su disable-verity -R >&2 || +adb_su disable-verity -R >&2 +err=${?} +[[ ${err} -eq 0 || ${err} -eq 255 ]] || die -t "${T}" "disable-verity -R failed" sleep 2 adb_wait "${ADB_WAIT}" || @@ -1192,7 +1194,9 @@ LOG OK "adb remount from scratch" LOG RUN "Testing adb remount -R" T=$(adb_date) -adb_su remount -R &2 || +adb_su remount -R &2 +err=${?} +[[ ${err} -eq 0 || ${err} -eq 255 ]] || die -t "${T}" "adb remount -R failed" sleep 2 adb_wait "${ADB_WAIT}" ||