metadata:
    format: Lava-Test Test Definition 1.0
    name: pi-stress
    description: "pi_stress checks Priority Inheritence Mutexes and their
                  ability to avoid Priority Inversion from occuring by running
                  groups of threads that cause Priority Inversions."
    maintainer:
        - chase.qi@linaro.org
    os:
        - debian
        - ubuntu
        - fedora
        - centos
        - openembedded
    scope:
        - functional
        - preempt-rt
    devices:
        - hi6220-hikey
        - apq8016-sbc
        - mustang
        - moonshot
        - thunderX
        - d03
        - d05

params:
    # Length of the test run
    DURATION: "5m"
    # Set MLOCKALL to "true" to lock current and future memory
    MLOCKALL: "false"
    # Set RR to "true" to use SCHED_RR for test threads.
    # It uses SCHED_FIFO by default.
    RR: "false"
    # Background workload to be run during the meassurement
    BACKGROUND_CMD: ""
    # Specify url and token for publishing artifacts.
    # For safety reasons, please set 'ARTIFACTORIAL_TOKEN' variable in job definition with
    # 'secrets' dictionary, and set job visibility to personal or group.
    # Refer to https://validation.linaro.org/static/docs/v2/publishing-artifacts.html
    ARTIFACTORIAL_URL: "https://archive.validation.linaro.org/artifacts/team/qa/"
    ARTIFACTORIAL_TOKEN: ""

run:
    steps:
        - cd automated/linux/pi-stress
        - ./pi-stress.sh -D "${DURATION}" -m "${MLOCKALL}" -r "${RR}" -w "${BACKGROUND_CMD}"
        - ../../utils/upload-to-artifactorial.sh -a "output/pi-stress.json" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
        - ../../utils/send-to-lava.sh ./output/result.txt
