.. # SPDX-FileCopyrightText: Copyright (c) 2025, Linaro Limited. # # SPDX-License-Identifier: MIT .. _dut_provisioning_label: **************** DUT Provisioning **************** This step is performed on the Device Under Test (DUT) to enable Mender client-server communication. Requirements: * :ref:`Running Mender server ` These are the required environment variables, refer :ref:`here ` for more details. * `MENDER_DUT_TEST_DIR` * `HOST_MACHINE_USER` * `MENDER_SERVER_DIR` * `MENDER_SERVER_NAME` * `MENDER_SERVER_IP` * `MENDER_SERVER_HTTPS_PORT` * `MENDER_SERVER_HTTP_PORT` Login and switch to root user .. code-block:: console sudo su - Create a working directory for Mender testing .. code-block:: console mkdir -p ${MENDER_DUT_TEST_DIR} chown -R cassini:cassini ${MENDER_DUT_TEST_DIR} cd ${MENDER_DUT_TEST_DIR} Copy Mender helper scripts and certificates from the host machine to the DUT .. code-block:: console scp -o "StrictHostKeyChecking no" ${HOST_MACHINE_USER}@${MENDER_SERVER_IP}:${MENDER_SERVER_DIR}/mender_*.sh ${MENDER_DUT_TEST_DIR} scp -o "StrictHostKeyChecking no" ${HOST_MACHINE_USER}@${MENDER_SERVER_IP}:${MENDER_SERVER_DIR}/compose/certs/mender.crt ${MENDER_DUT_TEST_DIR} .. note:: This step is required for ``corstone1000-fvp`` machine to prevent unexpected shutdown during the preparation of mender provisioning. .. code-block:: console timedatectl sudo systemctl restart systemd-timesyncd.service timedatectl sudo ip link set eth0 down Place the Mender server certificate in the correct location and adjust the permissions. Ensure the helper scripts are executable. .. code-block:: console cp ${MENDER_DUT_TEST_DIR}/mender.crt /etc/mender chmod 644 /etc/mender/mender.crt chmod +x ${MENDER_DUT_TEST_DIR}/mender_*.sh Enable helper functions to perform mender testing. .. code-block:: console source ${MENDER_DUT_TEST_DIR}/mender_test_helper.sh Restart Mender-related services to apply changes. .. code-block:: console systemctl restart mender-authd systemctl restart mender-updated .. note:: This step is required for ``corstone1000-fvp`` machine to prevent unexpected shutdown during the preparation of mender provisioning. .. code-block:: console sudo ip link set eth0 up Run provisioning script to register DUT with the Mender server. .. code-block:: console provision_device