metadata:
    name: wait-and-keep-local-device-accessible
    format: "Lava-Test Test Definition 1.0"
    description: "Continuously wait for MultiNode messages from a remote role (master) and make the
        locally connected device accessible again when it is lost for the remote role."
    maintainer:
        - karsten@fairphone.com
        - softwareteam@fairphone.com
    os:
        - debian
        - ubuntu
    devices:
        - lxc
    scope:
        - functional

params:
    ADB_PORT: "5555"
    BOOT_TIMEOUT_SECS: "900"
    NETWORK_TIMEOUT_SECS: "300"
    ADB_TCPIP_ATTEMPTS: "5"
    ADB_CONNECT_TEST_TIMEOUT_SECS: "60"
    ANDROID_ENABLE_WIFI: "true"
    # Userdata image file that will be used to reset devices to a clean state
    # before starting TradeFed reruns.
    USERDATA_IMAGE_FILE: ""

run:
    steps:
        - lava-install-packages --no-install-recommends python3-pip python3-setuptools python3-wheel
        - pip3 install -q uiautomator
        - |
            USERDATA_IMAGE_FILE="${USERDATA_IMAGE_FILE}" \
                ./automated/android/multinode/wait-and-keep-local-device-accessible.sh
