metadata:
    name: rtla-osnoise
    format: "Lava-Test Test Definition 1.0"
    description: "The rtla osnoise tool is an interface for the osnoise tracer.
                  The osnoise tracer dispatches a kernel thread per-cpu.
                  These threads read the time in a loop while with preemption,
                  softirq and IRQs enabled, thus allowing all the sources of
                  operating system noise during its execution. The osnoise’s
                  tracer threads take note of the delta between each time
                  read, along with an interference counter of all sources of
                  interference. At the end of each period, the osnoise tracer
                  displays a summary of the results."
    maintainer:
        - Daniel Wagner <wagi@monom.org>
    os:
        - debian
        - ubuntu
        - fedora
        - centos
        - openembedded
    scope:
        - performance
        - preempt-rt
    environment:
        - lava-test-shell
    devices:
        - hi6220-hikey
        - apq8016-sbc
        - mustang
        - moonshot
        - thunderX
        - d03
        - d05

params:
    # Execute rtla osnoise for given time
    DURATION: "5m"
    # 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/rtla/
        - ./rtla-osnoise.sh -d "${DURATION}" -w "${BACKGROUND_CMD}"
        - ../../utils/upload-to-artifactorial.sh -a "output/rtla-osnoise.json" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
        - ../../utils/upload-to-artifactorial.sh -a "output/osnoise_thread_noise_hist.txt" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
        - ../../utils/upload-to-artifactorial.sh -a "output/osnoise_irq_noise_hist.txt" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
        - ../../utils/upload-to-artifactorial.sh -a "output/osnoise_sample_threshold_hist.txt" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
        - ../../utils/send-to-lava.sh ./output/result.txt
