aboutsummaryrefslogtreecommitdiff
path: root/automated/android/ion-monitor-tool/ion-monitor-tool.yaml
blob: 2c18f264ffbeef6ac483d5690d2dd6eff24f0c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
metadata:
    name: ion-monitor-tool
    format: "Lava-Test Test Definition 1.0"
    description: "Run ion monitor tool to check memory leaks."
    maintainer:
        - axel.lebourhis@linaro.org
    os:
        - ubuntu
    devices:
        - lxc

params:
    HEAP: "/sys/kernel/debug/ion/display"
    REPEAT: "5"
    CLEAR: "true"
    SECURE: "false"
    UHD: "false"
    UPLOAD_URL: ""
    BINARY_URL: "https://github.com/linaro-mmwg/ionmonitortool/releases/download/V1.0/ion-monitor-tool"

run:
    steps:
        - cd ./automated/android/ion-monitor-tool
        - . ./setup.sh 
        - echo "Setup done"
        - wget ${BINARY_URL} -O ion-monitor-tool.bin
        - adb push ./ion-monitor-tool.bin /data
        - ./runner.sh -h ${HEAP} -r ${REPEAT} -c ${CLEAR} -s ${SECURE} -u ${UHD}
        - mkdir -p ./output
        # retrieve logs from the tool
        - adb pull /data/allocated_size.log ./output
        - adb pull /data/free_size.log ./output
        - adb pull /data/allocated_peak.log ./output
        - adb pull /data/largest_free_buffer.log ./output
        - adb pull /data/heap_fragmentation.log ./output
        # prepare archive
        - ATTACHMENT="ion-monitor-tool-$(date +%Y%m%d-%H%M).tar.xz"
        - tar caf "${ATTACHMENT}" output
        # upload archive if server URL provided
        - if [ ! -z "${UPLOAD_URL}" ]; then curl -F "file=@${ATTACHMENT}" "${UPLOAD_URL}"; fi
        - if [ ! -z "${UPLOAD_URL}" ]; then lava-test-reference "test-attachment" --result "pass" --reference "${UPLOAD_URL}${ATTACHMENT}"; fi