DUT Provisioning

This step is performed on the Device Under Test (DUT) to enable Mender client-server communication.

Requirements:

These are the required environment variables, refer 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

sudo su -

Create a working directory for Mender testing

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

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.

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.

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.

source ${MENDER_DUT_TEST_DIR}/mender_test_helper.sh

Restart Mender-related services to apply changes.

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.

sudo ip link set eth0 up

Run provisioning script to register DUT with the Mender server.

provision_device