metadata:
    name: lmp-device-register-invalid-token-header
    format: "Manual Test Definition 1.0"
    description: "Register device with token header mismatch"
    maintainer:
        - brendan.wood@foundries.io
    os:
        - ubuntu
        - openembedded
    scope:
        - functional
    devices:
        - imx6mm-evk
        - imx8mm-evk
        - imx8mm-evk-sec
        - imx8mp-evk
        - imx8mq-evk
        - bcm2711-rpi-4-b
        - stm32mp32mp157c-dk2
    environment:
        - manual-test

run:
    steps:
        - Create valid api token on app.foundries.io with "devices:create" for <factory>
        - Boot up the device
        - Ensure device is not registered to a factory
          Check /var/sota/sql.db is not present on device
        - Run "lmp-device-register -T <valid-api-token> -H FOO-Token -n <name>"

    expected:
        - Device should not register
        - Failure to authenticate
        - Expected error  Unable to create device  HTTP_401 Authorization Required
