Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3c13819
sanity-check: set shellcheck level to warning
mwasilew Jan 14, 2025
881b65a
sanity-check: add more comments to the script
mwasilew Jan 14, 2025
b52bb27
automated: android: disable SC2320 checks
mwasilew Jan 14, 2025
649fbe3
automated: linux: update bootrr definition
mwasilew Jan 10, 2025
f4e3469
automated: linux: add alsa-smoke test
mwasilew Jan 14, 2025
41161a0
automated: utils: remove distutils from test-runner
mwasilew Feb 11, 2025
9e068e0
automated: lib: fix black warning
mwasilew Feb 11, 2025
aa509b9
upload-to-squad.sh: use "Authorization" in header for uploading
liuyq Jan 13, 2025
48fa901
automated: linux: ltp: remove kirk's report.json after parsing it
roxell Feb 27, 2025
a979f01
automated: linux: ltp: fix typo
terceiro Mar 7, 2025
a131279
automated: linux: ltp: allow not passing a skipfile to kirk
terceiro Mar 7, 2025
45a4d4a
send-to-lava: add support for publishing log files
terceiro Mar 10, 2025
aac60d9
automated: linux: ltp: publish log files for kirk runs
terceiro Mar 10, 2025
3462ad8
automation: linux: pmqtest: fix indentation
roxell Mar 16, 2025
b6f14bb
automated: linux: pi-stress: fix indentation
roxell Mar 16, 2025
5333a75
automated: linux: signaltest: fix indentation
roxell Mar 16, 2025
845a37b
automated: linux: rt-migrate-test: fix indentation
roxell Mar 16, 2025
0d993fa
automated: linux: cyclicdeadline: fix indentation
roxell Mar 16, 2025
9ebdd88
automated: linux: pmqtest: add iterations
roxell Mar 21, 2025
c6056a1
automated: lib: parse_rt_tests_results: pi-stress: fix output
roxell Mar 21, 2025
970fdbc
automated: linux: pi-stress: add iterations
roxell Feb 21, 2025
2c35bc0
automated: linux: signaltest: add iterations
roxell Feb 27, 2025
8ed13f7
automated: linux: rt-migrate-test: add iterations
roxell Feb 28, 2025
24a05ce
automated: linux: cyclicdeadline: add iterations
roxell Feb 28, 2025
9d6d8c7
automated: linux: kselftest: publish kselftest logs
TheodoreRTG Mar 24, 2025
219912a
automated: linux: pmqtest: parse: fix iteration parsing
roxell Apr 1, 2025
166ebc6
automated: linux: pi-stress: parse: fix iteration parsing
roxell Apr 1, 2025
f5ff066
automated: linux: signaltest: parse: fix iteration parsing
roxell Apr 1, 2025
322731b
automated: linux: rt-migrate-test: parse: fix iteration parsing
roxell Apr 1, 2025
18fbcf2
automated: linux: cyclicdeadline: parse: fix iteration parsing
roxell Apr 1, 2025
86b92d5
noninteractive-tradefed: add java path support for aarch64 (#555)
liuyq Apr 2, 2025
6bcdc25
automated: linux: kselftest: fix kselftest log publish
TheodoreRTG Apr 8, 2025
c685ba3
automated: linux: ltp: don't duplicate LTP output
terceiro Apr 8, 2025
ffdabde
send-to-lava: don't warn on missing output
terceiro Apr 8, 2025
9560e5a
automated: linux: ltp: skip logs for passing tests
terceiro Apr 8, 2025
6684fb5
automated: linux: Add ALSA basic audio test (#557)
broonie Apr 9, 2025
5fee8f4
noninteractive-tradefed: using HTTP_CACHE to get kisscache url (#560)
liuyq Apr 16, 2025
bb8da64
utils: send-to-lava: respect KMSG if set by the job definition
terceiro Apr 17, 2025
435fa23
docs: fix mkdocs_plugin installation
mwasilew Apr 29, 2025
eb8be1a
android: add the Android KUnit test (#563)
liuyq Apr 30, 2025
5c2c2bb
automated: linux: ltp: kirk runner: parallelize tests
roxell Apr 11, 2025
507af64
automated: linux: cyclicdeadline: add generic pass/fail logic
roxell Apr 28, 2025
1cfe0c2
automated: linux: cyclicdeadline: add pthreashold variable
roxell Apr 28, 2025
a0b6641
automated: linux: pi-stress: add generic pass/fail logic
roxell Apr 28, 2025
d45e326
automated: linux: pi-stress: add pthreashold variable
roxell Apr 29, 2025
a7b173b
automated: linux: modules: scan dmesg for errors
roxell Apr 28, 2025
e6199bd
automated: linux: modules: check for stuck modules
roxell Apr 28, 2025
ad114aa
automated: linux: modules: add kmemleak scan
roxell Apr 28, 2025
25fd951
automated: linux: modules: fix get_modules_list fallback logic
roxell Apr 28, 2025
a52e64b
automated: linux: pi-stress: fix threshold
roxell May 7, 2025
6662ecf
automated: linux: pi-stress: allow user-specified baseline
roxell May 7, 2025
975b3d4
automated: linux: cyclicdeadline: add user-specified baseline
roxell May 7, 2025
249ed0a
automated: lib: modify check_return to support xfail
mwasilew May 15, 2025
302686d
automated: lib: fix shellcheck warnings
mwasilew May 15, 2025
e725467
automated: linux: add more options to docker networking
mwasilew May 12, 2025
81eaa21
automated: linux: kselftest: Deduplicate test names with minuses
broonie May 28, 2025
737f627
automated: linux: add tcpreplay testing framework
roxell Mar 12, 2025
cb19cb9
automated: linux: modules: add memory check
roxell Jun 5, 2025
7639dc2
automated: linux: ltp: Allow detection of the number of CPUs at runti…
broonie Jun 17, 2025
260e212
automated: linux: ltp: Disable colour output from kirk
broonie Jun 18, 2025
eb4a938
automated: linux: kselftest: filter skip entries by subsuite
roxell Jun 17, 2025
0205ad2
automated: linux: ltp: Speed up parsing of JSON results
broonie Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Install current plugin
run: |
python mkdocs_plugin/setup.py install --force
pip install mkdocs_plugin/
pip freeze

- name: Build docs
Expand Down
2 changes: 2 additions & 0 deletions automated/android/bootchart/device-script.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/system/bin/sh
# shellcheck disable=SC2181
# shellcheck disable=SC2320
#
# script to start and stop bootchart test.
#
# Copyright (C) 2014, Linaro Limited.
# Copyright (C) 2025, Qualcomm Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
146 changes: 146 additions & 0 deletions automated/android/kunit/kunit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#!/bin/bash -ex

# shellcheck disable=SC1091
. ../../lib/sh-test-lib
DIR_OUTPUT="$(pwd)/output"
mkdir -p "${DIR_OUTPUT}"
RESULT_FILE="${DIR_OUTPUT}/result.txt"
export RESULT_FILE

# shellcheck disable=SC1091
. ../../lib/android-test-lib

RETRY_COUNT=5
RETRY_INTERVAL=2

TESTS_ZIP_URL=""
SQUAD_UPLOAD_URL=""
TRADEFED_PREBUILTS_GIT_URL="https://android.googlesource.com/platform/tools/tradefederation/prebuilts"

F_TESTS_ZIP="$(pwd)/tests.zip"
DIR_TESTS="$(pwd)/tests"
DIR_TEST_LOGS="${DIR_OUTPUT}/test-logs"
F_KUNIT_LOG="${DIR_TEST_LOGS}/kunit.log"
DIR_TF_PREBUILTS="$(pwd)/prebuilts"

function usage(){
echo "Usage: $0 -u <TESTS_ZIP_URL> [ -s <SQUAD_UPLOAD_URL>]" 1>&2
exit 1
}

function upload_logs_to_squad(){
if [ -z "${SQUAD_UPLOAD_URL}" ]; then
return
fi
# Upload test log and result files to artifactorial.
name_dir_output=$(basename "${DIR_OUTPUT}")
if ! tar caf "kunit-output-$(date +%Y%m%d%H%M%S).tar.xz" "${name_dir_output}"; then
error_fatal "tradefed - failed to collect results and log files [$ANDROID_SERIAL]"
fi
ATTACHMENT=$(ls kunit-output-*.tar.xz)
../../utils/upload-to-squad.sh -a "${ATTACHMENT}" -u "${SQUAD_UPLOAD_URL}"
}

function parse_kunit_log(){
local f_kunit_log="${1}"
local f_kunit_stub_log="${DIR_TEST_LOGS}/kunit_stub.log"

if [ -z "${f_kunit_log}" ] || [ ! -f "${f_kunit_log}" ]; then
echo "KUnit log does not exist"
return
fi
# grep the stub log to a single file and parsing the results
# 20:43:20 stub: soc-utils-test.soc-utils#test_snd_soc_params_to_bclk: PASSED (0ms)
# 00:21:09 stub: kunit-example-test.example_init#example_init_test: PASSED (0ms)
# | cut -d: -f4- \ # kunit-example-test.example_init#example_init_test: PASSED (0ms)
# | tr -d ':' \ # kunit-example-test.example_init#example_init_test PASSED (0ms)
# | awk '{print $1, $2}' \ # kunit-example-test.example_init#example_init_test PASSED
# | sort | uniq \ # to filter out the duplication of FAILURE in Result Summary part
grep "stub:" "${f_kunit_log}" \
| cut -d: -f4- \
| tr -d ':' \
| awk '{print $1, $2}' \
| sort | uniq \
> "${f_kunit_stub_log}"
while read -r line; do
# kunit-example-test.example_init#example_init_test PASSED
# kunit-example-test.example#example_skip_test IGNORED
# soc-utils-test#soc-utils-test FAILURE
test_case_name=$(echo "${line}"|awk '{print $1}')
test_case_result=$(echo "${line}"|awk '{print $2}')

# reformat the test case name to avoid potential confusions
# being caused by some special characters
test_case_name=$(echo "${test_case_name}" \
| tr -c '#@/+,[:alnum:]:.-' '_' \
| tr -s '_' \
| sed 's/_$//' \
)

case "X${test_case_result}" in
"XPASSED")
report_pass "${test_case_name}"
;;
"XIGNORED")
report_skip "${test_case_name}"
;;
"XFAILURE")
report_fail "${test_case_name}"
;;
*)
report_unknown "${test_case_name}"
;;
esac
done < "${f_kunit_stub_log}"
}

while getopts "u:s:h" o; do
case "$o" in
u) TESTS_ZIP_URL="${OPTARG}" ;;
s) SQUAD_UPLOAD_URL="${OPTARG}" ;;
h|*) usage ;;
esac
done

# export ANDROID_SERIAL
initialize_adb

if [ -z "${TESTS_ZIP_URL}" ]; then
echo "The TESTS_ZIP_URL must be specified."
exit 1
fi

# download and unzip tests.zip
rm -f "${F_TESTS_ZIP}" && \
curl --retry "${RETRY_COUNT}" --retry-delay "${RETRY_INTERVAL}" -fsSL "${TESTS_ZIP_URL}" -o "${F_TESTS_ZIP}"
rm -fr "${DIR_TESTS}" && \
mkdir -p "${DIR_TESTS}" && \
unzip -o "${F_TESTS_ZIP}" -d "${DIR_TESTS}"

# clone the tradefed prebuilts repository
i=1
while [ $i -le "${RETRY_COUNT}" ]; do
rm -fr "${DIR_TF_PREBUILTS}"
if git clone --depth 1 "${TRADEFED_PREBUILTS_GIT_URL}" "${DIR_TF_PREBUILTS}"; then
break
fi

# try again in ${RETRY_INTERVAL} seconds
sleep "${RETRY_INTERVAL}"
i=$((i + 1))
done

# run the kunit test
mkdir -p "${DIR_TEST_LOGS}"
prebuilts/filegroups/tradefed/tradefed.sh \
run commandAndExit \
template/local_min \
--template:map test=suite/test_mapping_suite \
--include-filter kunit \
--tests-dir="${DIR_TESTS}" \
--log-file-path="${DIR_TEST_LOGS}" \
-s "${ANDROID_SERIAL}" |& tee "${F_KUNIT_LOG}"

parse_kunit_log "${F_KUNIT_LOG}"

upload_logs_to_squad
34 changes: 34 additions & 0 deletions automated/android/kunit/kunit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
metadata:
name: kunit-tests
format: "Lava-Test Test Definition 1.0"
description: |
Run the KUnit test on Android based on the tradefed framework
provided by google.
maintainer:
- yongqin.liu@linaro.org
os:
- android
devices:
- db845c
- rb5
- sm8550
scope:
- functional

params:
# The url of the tests.zip file generated during the kernel build,
# which includes files for the kunit modules and necessary configurations
TESTS_ZIP_URL: ""
# The SQUAD url to be used to upload the result and log files.
# see https://squad.readthedocs.io/en/latest/intro.html#submitting-results.
# SQUAD_ARCHIVE_SUBMIT_TOKEN is used for uploading authentication,
# and must be defined by the submitter as one profile managed token
SQUAD_UPLOAD_URL: ""

run:
steps:
- cd ./automated/android/kunit
# Run setup.sh in the original shell to reserve env variables.
- ./kunit.sh -u "${TESTS_ZIP_URL}" -s "${SQUAD_UPLOAD_URL}"
# Send test result to LAVA.
- ../../utils/send-to-lava.sh ./output/result.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# shellcheck disable=SC2181
# shellcheck disable=SC2155
# shellcheck disable=SC2166
# shellcheck disable=SC2320
# shellcheck disable=SC3006
# shellcheck disable=SC3010
# shellcheck disable=SC3018
Expand All @@ -12,13 +13,15 @@
# shellcheck disable=SC3060
#############################################################################
# Copyright (c) 2014 Linaro
# Copyright (c) 2025 Qualcomm Inc
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Linaro <linaro-dev@lists.linaro.org>
# Milosz Wasilewski <milosz.wasilewski@oss.qualcomm.com>
#############################################################################

# Individual and batch test definitions
Expand Down
9 changes: 7 additions & 2 deletions automated/android/noninteractive-tradefed/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
. ../../lib/sh-test-lib
. ../../lib/android-test-lib

java_path="/usr/lib/jvm/java-11-openjdk-amd64/bin/java"
## To enable running x86_64 binary on aarch64 host or inside container of it
java_path_arch_str="amd64"
if [ "X$(uname -m)" = "Xaarch64" ]; then
java_path_arch_str="arm64"
fi
java_path="/usr/lib/jvm/java-11-openjdk-${java_path_arch_str}/bin/java"
if [ -n "${ANDROID_VERSION}" ] && echo "${ANDROID_VERSION}" | grep -E -q "aosp-android14|aosp-main"; then
# use openjdk-17 for Android14+ versions
java_path="/usr/lib/jvm/java-17-openjdk-amd64/bin/java"
java_path="/usr/lib/jvm/java-17-openjdk-${java_path_arch_str}/bin/java"
fi

dist_name
Expand Down
13 changes: 12 additions & 1 deletion automated/android/noninteractive-tradefed/tradefed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,18 @@ file_name=$(basename "${TEST_URL}")
if echo "${TEST_URL}" | grep "^http://lkft-cache.lkftlab/" ; then
NO_PROXY=.lkftlab wget -S --progress=dot:giga "${TEST_URL}" -O "${file_name}"
elif echo "${TEST_URL}" | grep "^http" ; then
wget -S --progress=dot:giga "${TEST_URL}" -O "${file_name}"
# using kisscache to download the file, based on the following change:
# https://gitlab.com/lava/lava/-/merge_requests/2734
# shellcheck disable=SC2153
if [ -n "${HTTP_CACHE}" ]; then
# and it's in the format like this:
# https://cache.lavasoftware.org/api/v1/fetch/?url=%s
# so need to remove "%s" first here
http_cache=$(echo "${HTTP_CACHE}"|sed 's|%s||')
wget -S --progress=dot:giga "${http_cache}${TEST_URL}" -O "${file_name}"
else
wget -S --progress=dot:giga "${TEST_URL}" -O "${file_name}"
fi
else
cp "${TEST_URL}" "./${file_name}"
fi
Expand Down
4 changes: 2 additions & 2 deletions automated/lib/parse_rt_tests_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def parse_json(testname, filename):
# rlta timertat also knows about irqs
parse_irqs(rawdata)

elif "inversions" in rawdata:
elif "inversion" in rawdata:
# pi_stress
print("inversion {}\n".format(rawdata("inversions")))
print("inversion pass {} count\n".format(rawdata["inversion"]))

if int(rawdata["return_code"]) == 0:
print("{} pass".format(testname))
Expand Down
3 changes: 1 addition & 2 deletions automated/lib/py_util_lib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Shared Python 3 utility code.
"""
"""Shared Python 3 utility code."""

from pathlib import Path
import subprocess
Expand Down
12 changes: 6 additions & 6 deletions automated/lib/sh-test-lib
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,16 @@ exit_on_skip() {
check_return() {
# shellcheck disable=SC2039
local exit_code="$?"
[ "$#" -ne 1 ] && error_msg "Usage: check_return test_case"
[ "$#" -lt 1 ] && error_msg "Usage: check_return test_case [xfail]"
# shellcheck disable=SC2039
local test_case="$1"
local xfail="${2:-}"

if [ "${exit_code}" -ne 0 ]; then
echo "${test_case} fail" | tee -a "${RESULT_FILE}"
if [ "${exit_code}" -ne 0 ] && [ -z "${xfail}" ]; then
report_fail "${test_case}"
return "${exit_code}"
else
echo "${test_case} pass" | tee -a "${RESULT_FILE}"
report_pass "${test_case}"
return 0
fi
}
Expand Down Expand Up @@ -237,7 +238,7 @@ dist_name() {
fi

# convert dist to lower case
dist=$(echo ${dist} | tr '[:upper:]' '[:lower:]')
dist=$(echo "${dist}" | tr '[:upper:]' '[:lower:]')
case "${dist}" in
rpb*) dist="oe-rpb" ;;
esac
Expand Down Expand Up @@ -336,7 +337,6 @@ validate_check_sum() {
if [ "$#" -ne 2 ]; then
warn_msg "The number of parameters should be 2"
error_msg "Usage: validate_check_sum filename known_sha256sum"
return 1
fi
# shellcheck disable=SC2039
local OUTPUT_FILE_NAME="$1"
Expand Down
72 changes: 72 additions & 0 deletions automated/linux/alsa-bat/bat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh -e
# shellcheck disable=SC1091

OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"

. ../../lib/sh-test-lib

create_out_dir "${OUTPUT}"

PARAMS=

if [ "${TST_CARD}" != "" ]; then
PARAMS="${PARAMS} -D${TST_CARD}"
fi

if [ "${TST_CHANNELS}" != "" ]; then
PARAMS="${PARAMS} -c${TST_CHANNELS}"
fi

if [ "${TST_PLAYBACK}" != "" ]; then
PARAMS="${PARAMS} -P${TST_PLAYBACK}"
fi

if [ "${TST_CAPTURE}" != "" ]; then
PARAMS="${PARAMS} -C${TST_CAPTURE}"
fi

if [ "${TST_FORMAT}" != "" ]; then
PARAMS="${PARAMS} -f${TST_FORMAT}"
fi

if [ "${TST_RATE}" != "" ]; then
PARAMS="${PARAMS} -r${TST_RATE}"
fi

if [ "${TST_LENGTH}" != "" ]; then
PARAMS="${PARAMS} -n${TST_LENGTH}"
fi

if [ "${TST_SIGMA_K}" != "" ]; then
PARAMS="${PARAMS} -k${TST_SIGMA_K}"
fi

if [ "${TST_FREQ}" != "" ]; then
PARAMS="${PARAMS} -F${TST_FREQ}"
fi

# Debian installs as alsabat due to name collisions
if [ "$(command -v alsabat)" != "" ]; then
BAT=alsabat
elif [ "$(command -v bat)" != "" ]; then
BAT=bat
fi

if [ "${BAT}" = "" ]; then
echo Unable to find BAT
exit 1
fi

TEST_NAME="$(echo "bat${PARAMS}" | sed 's/ /_/g' | sed 's/-//g')"

# Return code 0 for pass, other codes for various fails
if ${BAT} ${PARAMS} --log=${OUTPUT}/${TEST_NAME}.log ; then
R=pass
else
R=fail
fi

echo ${TEST_NAME} ${R} >> ${RESULT_FILE}

../../utils/send-to-lava.sh ${RESULT_FILE}
Loading