Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 2 | # |
| 3 | # Copyright (c) 2020, Arm Limited. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Generate a YAML file in order to dispatch Juno runs on LAVA. Note that this |
| 9 | # script would produce a meaningful output when run via Jenkins |
| 10 | # |
| 11 | # This is used exclusively to run a SCMI conformance test for SCP-Firmware on |
| 12 | # Juno. |
| 13 | |
| 14 | ci_root="$(readlink -f "$(dirname "$0")/..")" |
| 15 | source "$ci_root/utils.sh" |
| 16 | source "$ci_root/juno_utils.sh" |
| 17 | |
| 18 | get_recovery_image_url() { |
| 19 | local build_job="tf-build" |
| 20 | local bin_mode="debug" |
| 21 | |
| 22 | if upon "$jenkins_run"; then |
| 23 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/juno_recovery.zip" |
| 24 | else |
| 25 | echo "file://$workspace/artefacts/$bin_mode/juno_recovery.zip" |
| 26 | fi |
| 27 | } |
| 28 | |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 29 | recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}" |
| 30 | |
Manish Pandey | 7719a38 | 2020-09-07 12:30:18 +0100 | [diff] [blame^] | 31 | # Allow running juno tests on specific revision(r0/r1/r2). |
| 32 | juno_revision="${juno_revision:-}" |
| 33 | if [ ! -z "$juno_revision" ]; then |
| 34 | tags="tags:" |
| 35 | juno_revision="- ${juno_revision}" |
| 36 | else |
| 37 | tags="" |
| 38 | fi |
| 39 | |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 40 | cat <<EOF |
| 41 | device_type: juno |
| 42 | job_name: scp-tests-scmi-juno |
| 43 | |
Manish Pandey | 7719a38 | 2020-09-07 12:30:18 +0100 | [diff] [blame^] | 44 | $tags |
| 45 | $juno_revision |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 46 | |
| 47 | timeouts: |
| 48 | # Global timeout value for the whole job. |
| 49 | job: |
| 50 | minutes: 10 |
| 51 | actions: |
| 52 | lava-test-monitor: |
| 53 | seconds: 180 |
| 54 | connections: |
| 55 | lava-test-monitor: |
| 56 | seconds: 180 |
| 57 | |
| 58 | priority: medium |
| 59 | visibility: public |
| 60 | |
| 61 | actions: |
| 62 | |
| 63 | - deploy: |
| 64 | timeout: |
| 65 | minutes: 5 |
| 66 | to: vemsd |
| 67 | recovery_image: |
| 68 | url: $recovery_img_url |
| 69 | compression: zip |
| 70 | |
| 71 | - boot: |
| 72 | method: minimal |
| 73 | |
| 74 | - test: |
| 75 | timeout: |
| 76 | minutes: 8 |
| 77 | |
| 78 | monitors: |
| 79 | # |
| 80 | # Monitor no.1 |
| 81 | # Monitor the results from all the protocols but sensor |
| 82 | # |
| 83 | - name: SCP-SCMI-NON-SENSOR-PROTOCOL |
| 84 | start: 'BL31: Baremetal test suite: scmi' |
| 85 | end: 'Protocol Sensor' |
| 86 | |
| 87 | pattern: "\\\[(base|power|system_power|performance)\\\](-|_){(?P<test_case_id>\\\D*)(.*)}(-|_)(query|power|system_power|performance|precondition)_(.*)-01: (?P<result>(CONFORMANT|NON CONFORMANT))" |
| 88 | |
| 89 | fixupdict: |
| 90 | "CONFORMANT": pass |
| 91 | "NON CONFORMANT": fail |
| 92 | |
| 93 | # |
| 94 | # Monitor no.2 |
| 95 | # Monitor the results from the sensor protocols but for reading_get |
| 96 | # |
| 97 | - name: SCP-SCMI-SENSOR-PROTOCOL |
| 98 | start: 'SENSOR_DISCOVERY:' |
| 99 | end: 'query_sensor_description_get_non_existant_sensorid' |
| 100 | |
| 101 | pattern: "\\\[(sensor)\\\](-|_){(?P<test_case_id>\\\D*)(.*)}(-|_)(query|sensor)_(.*)-01: (?P<result>(CONFORMANT|NON CONFORMANT))" |
| 102 | |
| 103 | fixupdict: |
| 104 | "CONFORMANT": pass |
| 105 | "NON CONFORMANT": fail |
| 106 | |
| 107 | # |
| 108 | # Monitor no.3 |
| 109 | # Monitor the results from each individual sensor when performing the reading_get |
| 110 | # This special case is required since the baremetal application does not have |
| 111 | # any knowledge of the power state of the system. This results in a blind |
| 112 | # call to all the available sensors exposed by the platform, including ones |
| 113 | # tied to specific power domains that are in off state. The driver is then |
| 114 | # refusing to provide a reading for those sensors, causing a known fail for |
| 115 | # the test. |
| 116 | # The parser will therefore discard false failures. |
| 117 | # |
| 118 | - name: SCP-SCMI-SENSOR-PROTOCOL-GET |
| 119 | start: 'SENSOR_READING_GET:' |
| 120 | end: 'SCMI TEST: END' |
| 121 | |
| 122 | pattern: "SENSOR ID (?P<test_case_id>\\\d+)[\\\n|\\\r](.*)MESSAGE_ID = 0x06[\\\n|\\\r](.*)PARAMETERS (.*)[\\\n|\\\r](.*)CHECK HEADER:(.*)[\\\n|\\\r](.*)CHECK STATUS: (?P<result>(PASSED|FAILED))" |
| 123 | |
| 124 | fixupdict: |
| 125 | "PASSED": pass |
| 126 | "FAILED": fail |
| 127 | |
| 128 | |
| 129 | |
| 130 | # |
| 131 | # We have already tested with one agent above and the expectations are the |
| 132 | # same for the two agents. |
| 133 | # Collect the final results. |
| 134 | # |
| 135 | - name: SCP-SCMI |
Nicola Mazzucato | 3f9b912 | 2020-08-19 13:53:40 +0100 | [diff] [blame] | 136 | start: 'Test Suite: SCMI 103' |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 137 | end: 'End of Test Suite: SCMI' |
| 138 | |
| 139 | pattern: "\\\[UT\\\] Test Case: (?P<test_case_id>\\\D*)(.*) Result: (?P<result>[0-9])" |
| 140 | |
| 141 | fixupdict: |
| 142 | "0": pass |
| 143 | "1": fail |
| 144 | "2": fail |
| 145 | "3": fail |
| 146 | "4": fail |
| 147 | "5": fail |
| 148 | "6": fail |
| 149 | "7": fail |
| 150 | "8": fail |
| 151 | "9": fail |
| 152 | |
| 153 | |
| 154 | |
| 155 | EOF |