Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0afad08e authored by shihchienc's avatar shihchienc Committed by Patrick Chang
Browse files

threadnetwork: Avoid execute command if service does not exist

We might run VTS when the thread_network service is not available. This
patch prevents shell commands from being executed if the service is
absent.

Bug: 374009923
Bug: 355317617
Bug: 376750874
Test: atest VtsHalThreadNetworkTargetTest
Change-Id: I94dd7e2e7585e061f53291c47e46841e5e670b6c
(cherry picked from commit ae9ea3c8)
parent d93bf85e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -13,11 +13,12 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<configuration description="Runs VtsHalThreadNetworkTargetTest.">
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="run-command" value="cmd thread_network force-stop-ot-daemon enabled" />
        <option name="run-command" value="if pm list features |grep 'android.hardware.thread_network'; then cmd thread_network force-stop-ot-daemon enabled; fi" />
        <option name="run-command" value="cmd bluetooth_manager enable" />
        <option name="teardown-command" value="cmd thread_network force-stop-ot-daemon disabled" />
        <option name="teardown-command" value="if pm list features |grep 'android.hardware.thread_network'; then cmd thread_network force-stop-ot-daemon disabled; fi" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />