From 07adc1356eb7593d8b9f88299660aac6142d0bbd Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:08:02 +0530 Subject: [PATCH 1/7] Added support for LAVA framework including YAML files Integrated LAVA framework with new YAML plans Added send-to-lava.sh script with SPDX license header Removed redundant variables in YAML files Removed Audio_Premerge yaml file Copied send-to-lava.sh from linaro to support result parsing with LAVA framework. Original source: https://github.com/Linaro/test-definitions/blob/master/automated/utils/send-to-lava.sh License: GPL-2.0-only, MIT This change is added for LAVA framework support to all the scripts based on testplan. Added the license file with 644 permissionsin the same folder where send-to-lava.sh is present as per review comment Removed chmod permissions in testplansand gave permissions to repository Signed-off-by: Vamsee Narapareddi --- Runner/init_env | 13 +- Runner/plans/KernelCI_PreMerge.yaml | 54 +++ Runner/plans/meta-qcom_PreMerge.yaml | 58 +++ Runner/run-test.sh | 0 .../FunctionalArea/baseport/BWMON/run.sh | 6 +- .../FunctionalArea/baseport/Buses/run.sh | 6 +- .../baseport/CPUFreq_Validation/run.sh | 2 + .../Kernel/FunctionalArea/baseport/GIC/run.sh | 4 +- .../Kernel/FunctionalArea/baseport/IPA/run.sh | 4 +- .../FunctionalArea/baseport/IPCC/run.sh | 4 +- .../FunctionalArea/baseport/Interrupts/run.sh | 18 +- .../FunctionalArea/baseport/MEMLAT/run.sh | 4 +- .../FunctionalArea/baseport/RMNET/run.sh | 4 +- .../baseport/Reboot_health_check/run.sh | 0 .../Reboot_health_check/setup_systemd.sh | 0 .../FunctionalArea/baseport/Timer/run.sh | 4 +- .../baseport/adsp_remoteproc/run.sh | 8 +- .../baseport/cdsp_remoteproc/run.sh | 8 +- .../FunctionalArea/baseport/hotplug/run.sh | 3 +- .../FunctionalArea/baseport/iommu/run.sh | 4 +- .../Kernel/FunctionalArea/baseport/irq/run.sh | 4 +- .../FunctionalArea/baseport/kaslr/run.sh | 2 + .../FunctionalArea/baseport/pinctrl/run.sh | 4 +- .../FunctionalArea/baseport/qcrypto/run.sh | 4 +- .../FunctionalArea/baseport/remoteproc/run.sh | 4 +- .../FunctionalArea/baseport/rngtest/run.sh | 4 +- .../FunctionalArea/baseport/smmu/run.sh | 4 +- .../FunctionalArea/baseport/storage/run.sh | 10 +- .../FunctionalArea/baseport/watchdog/run.sh | 4 +- .../baseport/wpss_remoteproc/run.sh | 8 +- Runner/utils/LICENSE | 354 ++++++++++++++++++ Runner/utils/basics.sh | 0 Runner/utils/functestlib.sh | 0 Runner/utils/platform.sh | 0 Runner/utils/send-to-lava.sh | 52 +++ 35 files changed, 587 insertions(+), 71 deletions(-) create mode 100755 Runner/plans/KernelCI_PreMerge.yaml create mode 100755 Runner/plans/meta-qcom_PreMerge.yaml mode change 100644 => 100755 Runner/run-test.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh mode change 100644 => 100755 Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh create mode 100644 Runner/utils/LICENSE mode change 100644 => 100755 Runner/utils/basics.sh mode change 100644 => 100755 Runner/utils/functestlib.sh mode change 100644 => 100755 Runner/utils/platform.sh create mode 100755 Runner/utils/send-to-lava.sh diff --git a/Runner/init_env b/Runner/init_env index 54755dc..44bc442 100755 --- a/Runner/init_env +++ b/Runner/init_env @@ -2,13 +2,6 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear # Source this file to setup the test suite environment -if [ -e '/var/Runner' ];then - export BASEDIR='/var/Runner' - export TOOLS='/var/Runner/utils' - export SUITES='/var/Runner/suites' - export CALIBRATION='/var/Runner/calib.txt' - export FTRACE_EVENTS='/var/Runner/ftrace_events' - export PATH=$PATH:'/bin' - export PATH=$PATH:'/sbin' -fi - +export BASEDIR=$(pwd) +export TOOLS=$(pwd)/utils +export SUITES=$(pwd)/suites \ No newline at end of file diff --git a/Runner/plans/KernelCI_PreMerge.yaml b/Runner/plans/KernelCI_PreMerge.yaml new file mode 100755 index 0000000..1370540 --- /dev/null +++ b/Runner/plans/KernelCI_PreMerge.yaml @@ -0,0 +1,54 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: AUSanity + description: "Baseline AU Sanity test plan" + maintainer: + - vnarapar@qti.qualcomm.com + os: + - openembedded + scope: + - functional + devices: + - rb3gen2 + +run: + steps: + - cd Runner + - $PWD/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/adsp_remoteproc.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/cdsp_remoteproc.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/CPUFreq_Validation.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/GIC/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/GIC/GIC.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/hotplug/hotplug.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/Interrupts/Interrupts.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/iommu/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/iommu/iommu.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/IPA/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/IPA/IPA.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/IPCC/IPCC.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/irq/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/irq/irq.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/kaslr/kaslr.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/pinctrl/pinctrl.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/Reboot_health_check.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/remoteproc/remoteproc.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/RMNET/RMNET.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/smmu/smmu.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/storage/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/storage/storage.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/watchdog/watchdog.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/wpss_remoteproc.res || true diff --git a/Runner/plans/meta-qcom_PreMerge.yaml b/Runner/plans/meta-qcom_PreMerge.yaml new file mode 100755 index 0000000..7d1af6e --- /dev/null +++ b/Runner/plans/meta-qcom_PreMerge.yaml @@ -0,0 +1,58 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: AUSanity + description: "Baseline AU Sanity test plan" + maintainer: + - vnarapar@qti.qualcomm.com + os: + - openembedded + scope: + - functional + devices: + - rb3gen2 + +run: + steps: + - cd Runner + - $PWD/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/adsp_remoteproc.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/cdsp_remoteproc.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/CPUFreq_Validation.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/GIC/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/GIC/GIC.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/hotplug/hotplug.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/Interrupts/Interrupts.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/iommu/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/iommu/iommu.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/IPA/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/IPA/IPA.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/IPCC/IPCC.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/irq/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/irq/irq.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/kaslr/kaslr.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/pinctrl/pinctrl.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/qcrypto/qcrypto.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/Reboot_health_check.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/remoteproc/remoteproc.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/RMNET/RMNET.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/smmu/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/smmu/smmu.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/storage/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/storage/storage.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/Timer/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/Timer/Timer.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/watchdog/watchdog.res || true + - $PWD/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh || true + - $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/wpss_remoteproc.res || true diff --git a/Runner/run-test.sh b/Runner/run-test.sh old mode 100644 new mode 100755 diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh old mode 100644 new mode 100755 index 3b6f515..188b295 --- a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh @@ -54,9 +54,9 @@ done if $incremented; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + log_fail "$TESTNAME : Test Failed" + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh old mode 100644 new mode 100755 index 2b5d266..cccad53 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh @@ -21,9 +21,9 @@ output=$(i2c-msm-test -v -D /dev/i2c-0 -l | grep "ret:1") if echo "$output" | grep -q "Reading"; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + log_fail "$TESTNAME : Test Failed" + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh old mode 100644 new mode 100755 index a4bfd92..15e969e --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -120,11 +120,13 @@ if $overall_pass; then echo -e "${GREEN}[OVERALL PASS]${NC} All CPUs validated successfully." log_pass "$TESTNAME : Test Passed" echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res" exit 0 else echo -e "${RED}[OVERALL FAIL]${NC} Some CPUs failed frequency validation." log_fail "$TESTNAME : Test Failed" echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" exit 1 fi diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh old mode 100644 new mode 100755 index a7af3e6..6accbf7 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -57,10 +57,10 @@ echo "$initial_count" | while read -r line; do echo $fail_test if [ "$fail_test" = false ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res fi + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res done log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh old mode 100644 new mode 100755 index 5410633..c7e6274 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -42,10 +42,10 @@ log_info "output of insmod $TEST" if /sbin/lsmod | /bin/grep "ipa"; then log_info "$(/sbin/lsmod | /bin/grep "ipa")" log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_error "rmnet module not running" log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh old mode 100644 new mode 100755 index bc7677a..0fdf0d0 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -18,9 +18,9 @@ count=$(echo "$output" | grep -c "running") if [ $count -eq 4 ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh old mode 100644 new mode 100755 index c3d84d6..4a81dc5 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -54,13 +54,13 @@ echo "$initial_count" | while read -r line; do fi i=$((i+1)) done - echo $fail_test - if [ "$fail_test" = false ]; then - log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res - else - log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res - fi + echo $fail_test + if [ "$fail_test" = false ]; then + log_pass "$TESTNAME : Test Passed" + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res + else + log_fail "$TESTNAME : Test Failed" + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res + fi done -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh old mode 100644 new mode 100755 index 6838187..7816239 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -55,9 +55,9 @@ else fi if $incremented; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh old mode 100644 new mode 100755 index a900906..d34c5f0 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -41,10 +41,10 @@ log_info "output of insmod $TEST" if /sbin/lsmod | /bin/grep "rmnet"; then log_info "$(/sbin/lsmod | /bin/grep "rmnet")" log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_error "rmnet module not running" log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh old mode 100644 new mode 100755 diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh old mode 100644 new mode 100755 diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh old mode 100644 new mode 100755 index 92ddb39..bf09e08 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -23,9 +23,9 @@ OUTPUT=$($BINARY_PATH) # Check if "pass:7" is in the output if [[ $OUTPUT == *"pass:7"* ]]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh old mode 100644 new mode 100755 index 34b3603..4e316eb --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -28,7 +28,7 @@ state1=$(cat ${remoteproc_path}/state) if [ "$state1" != "running" ]; then log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi @@ -40,7 +40,7 @@ echo stop > ${remoteproc_path}/state state3=$(cat ${remoteproc_path}/state) if [ "$state3" != "offline" ]; then log_fail "adsp stop failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 else log_pass "adsp stop successful" @@ -53,12 +53,12 @@ echo start > ${remoteproc_path}/state state5=$(cat ${remoteproc_path}/state) if [ "$state5" != "running" ]; then log_fail "adsp start failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi # If all checks pass, print "PASS" echo "adsp PASS" log_pass "adsp PASS" -echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res +echo "$TESTNAME PASS" > $test_path/$TESTNAME.res log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh old mode 100644 new mode 100755 index 733044d..c29b17f --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -27,7 +27,7 @@ remoteproc_path="/sys/class/remoteproc/remoteproc${remoteproc_number}" state1=$(cat ${remoteproc_path}/state) if [ "$state1" != "running" ]; then log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi @@ -38,7 +38,7 @@ echo stop > ${remoteproc_path}/state state3=$(cat ${remoteproc_path}/state) if [ "$state3" != "offline" ]; then log_fail "cdsp stop failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 else log_pass "cdsp stop successful" @@ -51,12 +51,12 @@ echo start > ${remoteproc_path}/state state5=$(cat ${remoteproc_path}/state) if [ "$state5" != "running" ]; then log_fail "cdsp start failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi # If all checks pass, print "PASS" echo "cdsp PASS" log_pass "cdsp PASS" -echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res +echo "$TESTNAME PASS" > $test_path/$TESTNAME.res log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh old mode 100644 new mode 100755 index 87b8bc2..4ae28ac --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -66,9 +66,10 @@ check_cpu_status | tee -a "$LOG_FILE" # Print overall test result if [ "$test_passed" = true ]; then log_pass "$TESTNAME : Test Passed" + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh old mode 100644 new mode 100755 index e769bb9..a4f8b77 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -18,9 +18,9 @@ OUTPUT=$(dmesg | grep iommu) # Check if the output is null if [ -z "$OUTPUT" ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh old mode 100644 new mode 100755 index 3c83921..9bb0021 --- a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh @@ -54,10 +54,10 @@ echo "$initial_count" | while read -r line; do if [ "$fail_test" = false ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi done log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh old mode 100644 new mode 100755 index 9fd64b0..90afa30 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -21,9 +21,11 @@ value=$(echo $output | awk '{print $1}') if [ $value == "0000000000000000" ]; then log_pass "$TESTNAME : Test Passed" + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh old mode 100644 new mode 100755 index 4cad2d3..ca5a3b9 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -19,9 +19,9 @@ output=$(ls /sys/kernel/debug/pinctrl) # Print overall test result if [ -z "$output" ]; then log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res else log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh old mode 100644 new mode 100755 index 2b07cf8..0f2c773 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -22,9 +22,9 @@ echo $? if [ $? -eq 0 ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh old mode 100644 new mode 100755 index 032709e..471e887 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -26,9 +26,9 @@ log_info "rproc subsystems in running state : $count, expected subsystems : $sub # Print overall test result if [ $count -eq $subsystem_count ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh old mode 100644 new mode 100755 index 4e79a01..c7eebff --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -24,9 +24,9 @@ value=$(cat /tmp/rngtest_value.txt) if [ "$value" -lt 10 ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh old mode 100644 new mode 100755 index b19c06b..57b885c --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -18,9 +18,9 @@ OUTPUT=$(dmesg | grep iommu) # Check if the output is null if [ -z "$OUTPUT" ]; then log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res else log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh old mode 100644 new mode 100755 index 045d65d..c6b5c83 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -23,22 +23,22 @@ if [ -f /tmp/a.txt ]; then if [ -s /tmp/a.txt ]; then log_pass "File /tmp/a.txt is not empty. Test Passed" log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "File /tmp/a.txt is empty. Test Failed." log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi else log_fail "File /tmp/a.txt is not created. Test Failed" log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi if [ -f /tmp/a.txt ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh old mode 100644 new mode 100755 index f30795d..64e5f57 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -15,10 +15,10 @@ log_info "-------------------Starting $TESTNAME Testcase------------------------ if [ -e /dev/watchdog ]; then log_pass "/dev/watchdog node is present." log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res + echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "/dev/watchdog node is not present." log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase---------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh old mode 100644 new mode 100755 index f118a7c..c72b16a --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -26,7 +26,7 @@ remoteproc_path="/sys/class/remoteproc/remoteproc${remoteproc_number}" state1=$(cat ${remoteproc_path}/state) if [ "$state1" != "running" ]; then log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi @@ -37,7 +37,7 @@ echo stop > ${remoteproc_path}/state state3=$(cat ${remoteproc_path}/state) if [ "$state3" != "offline" ]; then log_fail "wpss stop failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 else log_pass "wpss stop successful" @@ -50,12 +50,12 @@ echo start > ${remoteproc_path}/state state5=$(cat ${remoteproc_path}/state) if [ "$state5" != "running" ]; then log_fail "wpss start failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi # If all checks pass, print "PASS" echo "wpss PASS" log_pass "wpss PASS" -echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res +echo "$TESTNAME PASS" > $test_path/$TESTNAME.res log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/utils/LICENSE b/Runner/utils/LICENSE new file mode 100644 index 0000000..e4b9ee0 --- /dev/null +++ b/Runner/utils/LICENSE @@ -0,0 +1,354 @@ +Runner/utils/send-to-lava.sh: + +Script is from https://github.com/Linaro/test-definitions + +Copyright: 2012-2019 Linaro Limited + + 2019 Daniel Wagner + 2019 Daniel Wagner + 2019 Patryk Mungai + 2018 Karsten Tausche + 2018 Oleksandr Terentiev + 2017 Lei Yang +SPDX-License-Identifier: GPL-2.0-only + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/Runner/utils/basics.sh b/Runner/utils/basics.sh old mode 100644 new mode 100755 diff --git a/Runner/utils/functestlib.sh b/Runner/utils/functestlib.sh old mode 100644 new mode 100755 diff --git a/Runner/utils/platform.sh b/Runner/utils/platform.sh old mode 100644 new mode 100755 diff --git a/Runner/utils/send-to-lava.sh b/Runner/utils/send-to-lava.sh new file mode 100755 index 0000000..36d678e --- /dev/null +++ b/Runner/utils/send-to-lava.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +RESULT_FILE="$1" + +command -v lava-test-case > /dev/null 2>&1 +lava_test_case="$?" +command -v lava-test-set > /dev/null 2>&1 +lava_test_set="$?" + +if [ -f "${RESULT_FILE}" ]; then + while read -r line; do + if echo "${line}" | grep -iq -E ".* +(pass|fail|skip|unknown)$"; then + test="${line%% *}" + result="${line##* }" + + if [ "${lava_test_case}" -eq 0 ]; then + lava-test-case "${test}" --result "${result}" + else + echo "" + fi + elif echo "${line}" | grep -iq -E ".*+ (pass|fail|skip|unknown)+ .*+"; then + test="$(echo "${line}" | awk '{print $1}')" + result="$(echo "${line}" | awk '{print $2}')" + measurement="$(echo "${line}" | awk '{print $3}')" + units="$(echo "${line}" | awk '{print $4}')" + + if [ "${lava_test_case}" -eq 0 ]; then + if [ -n "${units}" ]; then + lava-test-case "${test}" --result "${result}" --measurement "${measurement}" --units "${units}" + else + lava-test-case "${test}" --result "${result}" --measurement "${measurement}" + fi + else + echo "" + fi + elif echo "${line}" | grep -iq -E "^lava-test-set.*"; then + test_set_status="$(echo "${line}" | awk '{print $2}')" + test_set_name="$(echo "${line}" | awk '{print $3}')" + if [ "${lava_test_set}" -eq 0 ]; then + lava-test-set "${test_set_status}" "${test_set_name}" + else + if [ "${test_set_status}" = "start" ]; then + echo "" + else + echo "" + fi + fi + fi + done < "${RESULT_FILE}" +else + echo "WARNING: result file is missing!" +fi From dfc0691b00e8fb9f01132e1434caa5bc5e97061c Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 13 May 2025 11:56:11 +0100 Subject: [PATCH 2/7] Replaced 'source' with '.' in all scripts for consistency Replaced 'source' with '.' in all scripts for consistency Cleaned up bash syntax for better readability and maintainability Signed-off-by: Vamsee Narapareddi --- Runner/run-test.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh | 4 ++-- .../FunctionalArea/baseport/CPUFreq_Validation/run.sh | 8 ++++---- Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh | 4 ++-- .../Kernel/FunctionalArea/baseport/Interrupts/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh | 2 +- .../FunctionalArea/baseport/Reboot_health_check/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh | 4 ++-- .../Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh | 4 ++-- .../Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/hotplug/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh | 4 ++-- .../Kernel/FunctionalArea/baseport/remoteproc/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/rngtest/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/storage/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/watchdog/run.sh | 4 ++-- .../Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh | 4 ++-- Runner/suites/Multimedia/DSP_AudioPD/run.sh | 2 +- Runner/suites/Multimedia/Graphics/run.sh | 2 +- .../suites/Multimedia/Video/iris_v4l2_video_decode/run.sh | 2 +- .../suites/Multimedia/Video/iris_v4l2_video_encode/run.sh | 2 +- Runner/utils/basics.sh | 4 ++-- Runner/utils/functestlib.sh | 6 +++--- 32 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Runner/run-test.sh b/Runner/run-test.sh index c89aad0..d26bfef 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -3,10 +3,10 @@ #!/bin/sh # Import test suite definitions -source /var/Runner/init_env +. $(pwd)/init_env #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh # Find test case path by name diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh index 188b295..9b933ec 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="BWMON" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh index cccad53..a08afa3 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="Buses" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh index 15e969e..b7a1a9d 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -1,14 +1,14 @@ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause-Clear -#!/bin/bash +#!/bin/sh +. "$(pwd)/init_env" # CPUFreq Validator: Parallel, Colorized /var/Runner/init_env TESTNAME="CPUFreq_Validation" +. "$TOOLS/functestlib.sh" -#import test functions library -source $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" @@ -130,4 +130,4 @@ else exit 1 fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index 6accbf7..5dfb56f 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="GIC" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index c7e6274..4d77ad2 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -3,7 +3,7 @@ #!/bin/sh # Import test suite definitions -source /var/Runner/init_env +. $(pwd)/init_env TESTNAME="IPA" #import test functions library log() { diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh index 0fdf0d0..1f13764 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="IPCC" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh index 4a81dc5..26e1c76 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="Interrupts" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh index 7816239..1712468 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -3,10 +3,10 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="MEMLAT" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") test_bin_path=$(find_test_case_bin_by_name "lat_mem_rd") log_info "-----------------------------------------------------------------------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh index d34c5f0..f6271cf 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -3,7 +3,7 @@ #!/bin/sh # Import test suite definitions -source /var/Runner/init_env +. $(pwd)/init_env TESTNAME="RMNET" #import test functions library diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh index bcf7ab6..3b96a2b 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh @@ -3,10 +3,10 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="Reboot_health_check" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") # Directory for health check files diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh index bf09e08..9d1cace 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="Timer" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh index 4e316eb..8c483c7 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="adsp_remoteproc" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh index c29b17f..2596be0 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="cdsp_remoteproc" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh index 4ae28ac..0bb0a34 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="hotplug" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh index a4f8b77..4e2eb00 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="iommu" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh index 9bb0021..40898ab 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="irq" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh index 90afa30..d3d89de 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -3,10 +3,10 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="kaslr" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh index ca5a3b9..32314ce 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="pinctrl" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh index 0f2c773..b4be7e4 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="qcrypto" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh index 471e887..763ac15 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="remoteproc" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh index c7eebff..153e5a9 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="rngtest" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh index 57b885c..68cef65 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="smmu" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh index c6b5c83..a1b61cf 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="storage" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh index 64e5f57..36c973f 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="watchdog" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh index c72b16a..04f345a 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -3,11 +3,11 @@ #!/bin/sh # Import test suite definitions -/var/Runner/init_env +. $(pwd)/init_env TESTNAME="wpss_remoteproc" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Multimedia/DSP_AudioPD/run.sh b/Runner/suites/Multimedia/DSP_AudioPD/run.sh index e6ad2ff..a94ea88 100755 --- a/Runner/suites/Multimedia/DSP_AudioPD/run.sh +++ b/Runner/suites/Multimedia/DSP_AudioPD/run.sh @@ -4,7 +4,7 @@ TESTNAME="DSP_AudioPD" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Multimedia/Graphics/run.sh b/Runner/suites/Multimedia/Graphics/run.sh index 031d882..f7f96f6 100755 --- a/Runner/suites/Multimedia/Graphics/run.sh +++ b/Runner/suites/Multimedia/Graphics/run.sh @@ -4,7 +4,7 @@ TESTNAME="Graphics" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh b/Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh index 0990bb1..68be7d6 100755 --- a/Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh +++ b/Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh @@ -4,7 +4,7 @@ TESTNAME="video_decode" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh b/Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh index 239129d..ee63ef4 100755 --- a/Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh +++ b/Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh @@ -4,7 +4,7 @@ TESTNAME="video_encode" #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/utils/basics.sh b/Runner/utils/basics.sh index 201b88a..4b99f42 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -2,13 +2,13 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear # Import test suite definitions -source ../../../../init_env +. $(pwd)/init_env #import platform . $TOOLS/platform.sh #import test functions library -source $TOOLS/functestlib.sh +. $TOOLS/functestlib.sh # CPU_FAST CPU_SLOW FTRACE_START_MARKER are used by the ftrace libraries diff --git a/Runner/utils/functestlib.sh b/Runner/utils/functestlib.sh index 644085d..c255629 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -3,11 +3,11 @@ # # Import test suite definitions -source /var/Runner/init_env +. $(pwd)/init_env #import platform -source $TOOLS/platform.sh +. $TOOLS/platform.sh -__RUNNER_SUITES_DIR="/var/Runner/suites" +__RUNNER_SUITES_DIR="$(pwd)/suites" __RUNNER_UTILS_BIN_DIR="/var/common" #This function used for test logging From e61691e11c26203f33f10804ce070d04906cd1de Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:45:25 +0530 Subject: [PATCH 3/7] Modified the find command to identify the testcase Modified the function find_test_case_by_name and run_specific_test_by_name in run-test.sh to find the testcase to execute easily without depending on find command Removed unwanted lines from run-test.sh as it is dead code Signed-off-by: Vamsee Narapareddi --- Runner/run-test.sh | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Runner/run-test.sh b/Runner/run-test.sh index d26bfef..563a3f8 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -11,8 +11,27 @@ # Find test case path by name find_test_case_by_name() { - local test_name="$1" - find /var/Runner/suites -type d -iname "$test_name" 2>/dev/null + # Check if the file is a directory + if [ -d "$1" ]; then + # Get the directory name + dir_name_in_dir=${1##*/} + + # Check if the directory name matches the user input (ignoring case) + if [ "${dir_name_in_dir,,}" = "$test_name" ]; then + # Get the absolute path of the directory + abs_path=$(readlink -f "$1") + echo "$abs_path" + fi + fi + + # Recursively search for the directory in the subdirectory + for file in "$1"/*; do + # Check if the file is a directory + if [ -d "$file" ]; then + # Recursively search for the directory in the subdirectory + find_test_case_by_name "$file" + fi + done } # Execute a test case @@ -23,11 +42,6 @@ execute_test_case() { if [ -f "$run_script" ]; then log "Executing test case: $test_path" sh "$run_script" 2>&1 - # if [ $? -eq 0 ]; then - # log "Test case $test_path passed." - # else - # log "Test case $test_path failed." - # fi else log "No run.sh found in $test_path" fi @@ -38,8 +52,9 @@ execute_test_case() { # Function to run a specific test case by name run_specific_test_by_name() { - local test_name="$1" - test_path=$(find_test_case_by_name "$test_name") + test_name="$1" + test_name=${test_name,,} + test_path=$(find_test_case_by_name ".") if [ -z "$test_path" ]; then log "Test case with name $test_name not found." else @@ -54,4 +69,4 @@ if [ "$#" -eq 0 ]; then fi -run_specific_test_by_name "$1" \ No newline at end of file +run_specific_test_by_name "$1" From 473683d75949a2aba36018e1b2ff42885fa0affd Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 13 May 2025 11:56:46 +0100 Subject: [PATCH 4/7] Fixed indentation in all shell scripts Fixed all the indentation issues in all shell scripts for consistancy Signed-off-by: Vamsee Narapareddi --- .../Kernel/FunctionalArea/baseport/GIC/run.sh | 14 +- .../Kernel/FunctionalArea/baseport/IPA/run.sh | 6 +- .../FunctionalArea/baseport/IPCC/run.sh | 2 +- .../FunctionalArea/baseport/Interrupts/run.sh | 4 +- .../FunctionalArea/baseport/MEMLAT/run.sh | 2 +- .../FunctionalArea/baseport/RMNET/run.sh | 6 +- .../FunctionalArea/baseport/Timer/run.sh | 2 +- .../baseport/adsp_remoteproc/run.sh | 8 +- .../baseport/cdsp_remoteproc/run.sh | 6 +- .../FunctionalArea/baseport/hotplug/run.sh | 11 +- .../FunctionalArea/baseport/iommu/run.sh | 2 +- .../FunctionalArea/baseport/kaslr/run.sh | 4 +- .../FunctionalArea/baseport/pinctrl/run.sh | 2 +- .../FunctionalArea/baseport/qcrypto/run.sh | 2 +- .../FunctionalArea/baseport/remoteproc/run.sh | 2 +- .../FunctionalArea/baseport/rngtest/run.sh | 2 +- .../FunctionalArea/baseport/smmu/run.sh | 2 +- .../FunctionalArea/baseport/storage/run.sh | 2 +- .../FunctionalArea/baseport/watchdog/run.sh | 4 +- .../baseport/wpss_remoteproc/run.sh | 4 +- Runner/utils/basics.sh | 532 +++++++++--------- Runner/utils/functestlib.sh | 9 +- Runner/utils/platform.sh | 8 +- 23 files changed, 315 insertions(+), 321 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index 5dfb56f..e45f035 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -46,7 +46,7 @@ echo "$initial_count" | while read -r line; do final_value=$(echo "$final_values_list" | sed -n "$((i+1))p") if [ "$initial_value" -lt "$final_value" ]; then echo "CPU $i: Timer count has incremented. Test PASSED" - log_pass "CPU $i: Timer count has incremented. Test PASSED" + log_pass "CPU $i: Timer count has incremented. Test PASSED" else echo "CPU $i: Timer count has not incremented. Test FAILED" log_fail "CPU $i: Timer count has not incremented. Test FAILED" @@ -54,13 +54,13 @@ echo "$initial_count" | while read -r line; do fi i=$((i+1)) done - echo $fail_test - if [ "$fail_test" = false ]; then - log_pass "$TESTNAME : Test Passed" - else - log_fail "$TESTNAME : Test Failed" - fi + echo $fail_test + if [ "$fail_test" = false ]; then + log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res + else + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res + fi done log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index 4d77ad2..0ee1c01 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -40,12 +40,12 @@ TEST=$(/sbin/insmod "$PATH") log_info "output of insmod $TEST" if /sbin/lsmod | /bin/grep "ipa"; then - log_info "$(/sbin/lsmod | /bin/grep "ipa")" + log_info "$(/sbin/lsmod | /bin/grep "ipa")" log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_error "rmnet module not running" - log_fail "$TESTNAME : Test Failed" + log_error "rmnet module not running" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh index 1f13764..ada89a0 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -20,7 +20,7 @@ if [ $count -eq 4 ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh index 26e1c76..ad6a903 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -46,7 +46,7 @@ echo "$initial_count" | while read -r line; do final_value=$(echo "$final_values_list" | sed -n "$((i+1))p") if [ "$initial_value" -lt "$final_value" ]; then echo "CPU $i: Timer count has incremented. Test PASSED" - log_pass "CPU $i: Timer count has incremented. Test PASSED" + log_pass "CPU $i: Timer count has incremented. Test PASSED" else echo "CPU $i: Timer count has not incremented. Test FAILED" log_fail "CPU $i: Timer count has not incremented. Test FAILED" @@ -57,10 +57,8 @@ echo "$initial_count" | while read -r line; do echo $fail_test if [ "$fail_test" = false ]; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi done log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh index 1712468..4a560e8 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -57,7 +57,7 @@ if $incremented; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh index f6271cf..4c95e87 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -39,12 +39,12 @@ TEST=$(/sbin/insmod "$PATH") log_info "output of insmod $TEST" if /sbin/lsmod | /bin/grep "rmnet"; then - log_info "$(/sbin/lsmod | /bin/grep "rmnet")" + log_info "$(/sbin/lsmod | /bin/grep "rmnet")" log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_error "rmnet module not running" - log_fail "$TESTNAME : Test Failed" + log_error "rmnet module not running" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh index 9d1cace..19717e4 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -25,7 +25,7 @@ if [[ $OUTPUT == *"pass:7"* ]]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh index 8c483c7..33e7e3c 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -29,7 +29,7 @@ state1=$(cat ${remoteproc_path}/state) if [ "$state1" != "running" ]; then log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res - exit 1 + exit 1 fi # Execute command 2 (no output expected) @@ -39,11 +39,11 @@ echo stop > ${remoteproc_path}/state # Execute command 3 and check if the output is "offline" state3=$(cat ${remoteproc_path}/state) if [ "$state3" != "offline" ]; then - log_fail "adsp stop failed" + log_fail "adsp stop failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 else - log_pass "adsp stop successful" + log_pass "adsp stop successful" fi log_info "Restarting remoteproc" # Execute command 4 (no output expected) @@ -52,7 +52,7 @@ echo start > ${remoteproc_path}/state # Execute command 5 and check if the output is "running" state5=$(cat ${remoteproc_path}/state) if [ "$state5" != "running" ]; then - log_fail "adsp start failed" + log_fail "adsp start failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 fi diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh index 2596be0..595475a 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -28,7 +28,7 @@ state1=$(cat ${remoteproc_path}/state) if [ "$state1" != "running" ]; then log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res - exit 1 + exit 1 fi # Execute command 2 (no output expected) @@ -37,11 +37,11 @@ echo stop > ${remoteproc_path}/state # Execute command 3 and check if the output is "offline" state3=$(cat ${remoteproc_path}/state) if [ "$state3" != "offline" ]; then - log_fail "cdsp stop failed" + log_fail "cdsp stop failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 else - log_pass "cdsp stop successful" + log_pass "cdsp stop successful" fi log_info "Restarting remoteproc" # Execute command 4 (no output expected) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh index 0bb0a34..c086b49 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -18,16 +18,16 @@ check_cpu_status() { op=0 offline_cpu() { echo 0 > "/sys/devices/system/cpu/$1/online" - op=$(cat "/sys/devices/system/cpu/$1/online") - if [ "$op" -ne 1 ]; then + op=$(cat "/sys/devices/system/cpu/$1/online") + if [ "$op" -ne 1 ]; then log_pass "/sys/devices/system/cpu/$1/online is offline as expected" fi } online_cpu() { echo 1 > "/sys/devices/system/cpu/$1/online" - op=$(cat "/sys/devices/system/cpu/$1/online") - if [ "$op" -ne 0 ]; then + op=$(cat "/sys/devices/system/cpu/$1/online") + if [ "$op" -ne 0 ]; then log_pass "/sys/devices/system/cpu/$1/online is online as expected" fi } @@ -67,9 +67,8 @@ check_cpu_status | tee -a "$LOG_FILE" if [ "$test_passed" = true ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh index 4e2eb00..422fae8 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -20,7 +20,7 @@ if [ -z "$OUTPUT" ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh index d3d89de..8d17d47 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -22,10 +22,8 @@ value=$(echo $output | awk '{print $1}') if [ $value == "0000000000000000" ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh index 32314ce..ab2de35 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -21,7 +21,7 @@ if [ -z "$output" ]; then log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res else - log_pass "$TESTNAME : Test Passed" + log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh index b4be7e4..eba8fbe 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -24,7 +24,7 @@ if [ $? -eq 0 ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh index 763ac15..fe873cc 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -28,7 +28,7 @@ if [ $count -eq $subsystem_count ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh index 153e5a9..19ef4f5 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -26,7 +26,7 @@ if [ "$value" -lt 10 ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh index 68cef65..d1079ac 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -20,7 +20,7 @@ if [ -z "$OUTPUT" ]; then log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res else - log_pass "$TESTNAME : Test Passed" + log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh index a1b61cf..9f5778e 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -38,7 +38,7 @@ if [ -f /tmp/a.txt ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "$TESTNAME : Test Failed" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh index 36c973f..ae50f0a 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -17,8 +17,8 @@ if [ -e /dev/watchdog ]; then log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res else - log_fail "/dev/watchdog node is not present." - log_fail "$TESTNAME : Test Failed" + log_fail "/dev/watchdog node is not present." + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi log_info "-------------------Completed $TESTNAME Testcase---------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh index 04f345a..a8f563a 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -27,7 +27,7 @@ state1=$(cat ${remoteproc_path}/state) if [ "$state1" != "running" ]; then log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res - exit 1 + exit 1 fi # Execute command 2 (no output expected) @@ -40,7 +40,7 @@ if [ "$state3" != "offline" ]; then echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res exit 1 else - log_pass "wpss stop successful" + log_pass "wpss stop successful" fi # Execute command 4 (no output expected) diff --git a/Runner/utils/basics.sh b/Runner/utils/basics.sh index 4b99f42..17bf777 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -40,23 +40,23 @@ PART_FAST=`echo $CONFIG_TARGET_BIG_CPUPART` commaslow= commafast= for cpu in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 21 22 23 24 25 26 ; do - $TASKSET -part $cpu,$IMPLEMENTER,$PART_SLOW >/dev/null - if [ $? == 0 ] ; then - CPU_SLOW=$CPU_SLOW$commaslow$cpu - commaslow=, - fi - $TASKSET -part $cpu,$IMPLEMENTER,$PART_FAST >/dev/null - if [ $? == 0 ] ; then - CPU_FAST=$CPU_FAST$commafast$cpu - commafast=, - fi + $TASKSET -part $cpu,$IMPLEMENTER,$PART_SLOW >/dev/null + if [ $? == 0 ] ; then + CPU_SLOW=$CPU_SLOW$commaslow$cpu + commaslow=, + fi + $TASKSET -part $cpu,$IMPLEMENTER,$PART_FAST >/dev/null + if [ $? == 0 ] ; then + CPU_FAST=$CPU_FAST$commafast$cpu + commafast=, + fi done echo "Fast CPU $CPU_FAST Slow CPU $CPU_SLOW" if [ ! -e /proc/sys/kernel/sched_upmigrate ] || [ ! -e /proc/sys/kernel/sched_downmigrate ]; then - echo "up-upmigrate and down-downmigrate values not exported. Precondition failure" - #non-zero exit signals test runner to declare this test as a failure - exit 1 + echo "up-upmigrate and down-downmigrate values not exported. Precondition failure" + #non-zero exit signals test runner to declare this test as a failure + exit 1 fi UP_THRESHOLD_1024=$(cat '/proc/sys/kernel/sched_upmigrate' | cut -f 1) @@ -87,89 +87,89 @@ HOG_PID= copy_trace_events() { - if [ -f $FTRACE_EVENTS/header_page ] ; then - echo "Trace events already copied" - TRACE_EVENTS_PATH=$FTRACE_EVENTS - return - fi - - echo "Copying trace events..." - odir=`pwd` - cd /sys/kernel/debug/tracing/events - mkdir $FTRACE_EVENTS - for i in * ; do - if [ -f $i ] ; then - cat $i > $FTRACE_EVENTS/$i - else - old=`pwd` - cd $i - mkdir $FTRACE_EVENTS/$i/ - for j in * ; do - if [ -f $j/format ] ; then - mkdir $FTRACE_EVENTS/$i/$j - cat $j/format > $FTRACE_EVENTS/$i/$j/format - fi - done - cd $old - fi - done - cd $odir - TRACE_EVENTS_PATH=$FTRACE_EVENTS + if [ -f $FTRACE_EVENTS/header_page ] ; then + echo "Trace events already copied" + TRACE_EVENTS_PATH=$FTRACE_EVENTS + return + fi + + echo "Copying trace events..." + odir=`pwd` + cd /sys/kernel/debug/tracing/events + mkdir $FTRACE_EVENTS + for i in * ; do + if [ -f $i ] ; then + cat $i > $FTRACE_EVENTS/$i + else + old=`pwd` + cd $i + mkdir $FTRACE_EVENTS/$i/ + for j in * ; do + if [ -f $j/format ] ; then + mkdir $FTRACE_EVENTS/$i/$j + cat $j/format > $FTRACE_EVENTS/$i/$j/format + fi + done + cd $old + fi + done + cd $odir + TRACE_EVENTS_PATH=$FTRACE_EVENTS } get_uptime() { - _temp="`cat /proc/uptime`" + _temp="`cat /proc/uptime`" # RESULT is the second integer of /proc/uptime - for _temp1 in $_temp ; do - RESULT=$_temp1 - done + for _temp1 in $_temp ; do + RESULT=$_temp1 + done } hog_cpu_fast() { - $HOG_CPU $CPU_FAST,$CPU_FAST,$CPU_FAST & - HOG_PID="$HOG_PID $!" + $HOG_CPU $CPU_FAST,$CPU_FAST,$CPU_FAST & + HOG_PID="$HOG_PID $!" } hog_cpu_slow() { - $HOG_CPU $CPU_SLOW,$CPU_SLOW,$CPU_SLOW & - HOG_PID="$HOG_PID $!" + $HOG_CPU $CPU_SLOW,$CPU_SLOW,$CPU_SLOW & + HOG_PID="$HOG_PID $!" } unhog_cpu() { - for i in $HOG_PID ; do - kill -10 $i - wait $i - done - HOG_PID= + for i in $HOG_PID ; do + kill -10 $i + wait $i + done + HOG_PID= } taskset_cpuslow() { - $TASKSET -pc $CPU_SLOW $1 + $TASKSET -pc $CPU_SLOW $1 } taskset_cpufast() { - $TASKSET -pc $CPU_FAST $1 + $TASKSET -pc $CPU_FAST $1 } taskset_cpuany() { - $TASKSET -pc $CPU_FAST,$CPU_SLOW $1 + $TASKSET -pc $CPU_FAST,$CPU_SLOW $1 } CALIBRATION=${CALIBRATION:-$BASEDIR/calib.txt} calibrate_tasklib() { - # share between test suites if possible - if [ ! -f $CALIBRATION ] ; then - $LOAD_GENERATOR --calibrate - mv calib.txt $CALIBRATION - fi + # share between test suites if possible + if [ ! -f $CALIBRATION ] ; then + $LOAD_GENERATOR --calibrate + mv calib.txt $CALIBRATION + fi } # Force load_generator calibration each time this file is sourced. @@ -179,231 +179,231 @@ calibrate_tasklib load_generator() { - echo "Using tasklibrary calibdation file: $CALIBRATION" - $LOAD_GENERATOR --calibfile=$CALIBRATION --loadseq=$1 & - RESULT=$! - if [ "$2" == "START_SLOW" ] ; then - taskset_cpuslow $RESULT - for ii in 0 ; do sleep 1; taskset_cpuany $RESULT ; done & - fi - if [ "$2" == "START_FAST" ] ; then - taskset_cpufast $RESULT - for ii in 0 ; do sleep 1; taskset_cpuany $RESULT ; done & - fi - if [ "$2" == "STARTSTOP_SLOW" ] ; then - taskset_cpuslow $RESULT - fi - if [ "$2" == "STARTSTOP_FAST" ] ; then - taskset_cpufast $RESULT - fi - echo "#load_generator PID=$RESULT COMMAND=$1" + echo "Using tasklibrary calibdation file: $CALIBRATION" + $LOAD_GENERATOR --calibfile=$CALIBRATION --loadseq=$1 & + RESULT=$! + if [ "$2" == "START_SLOW" ] ; then + taskset_cpuslow $RESULT + for ii in 0 ; do sleep 1; taskset_cpuany $RESULT ; done & + fi + if [ "$2" == "START_FAST" ] ; then + taskset_cpufast $RESULT + for ii in 0 ; do sleep 1; taskset_cpuany $RESULT ; done & + fi + if [ "$2" == "STARTSTOP_SLOW" ] ; then + taskset_cpuslow $RESULT + fi + if [ "$2" == "STARTSTOP_FAST" ] ; then + taskset_cpufast $RESULT + fi + echo "#load_generator PID=$RESULT COMMAND=$1" } ftrace_start() { - BOOST_GOVERNOR=${1:-1} - - if [ $ANDROID -eq 1 ]; then - echo "Stop all android services" - stop - fi - - if [ $BOOST_GOVERNOR -eq 1 ]; then - echo "Save current CPUFreq governors configuration" - i=0 - FTRACE_OLD_GOV="" - while [ $i != 9999 ] ; do - temp="` cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor 2>/dev/null`" - if [ "$temp" == "" ] ; then - i=9999 - else - let i=$i+1 - FTRACE_OLD_GOV="$FTRACE_OLD_GOV $temp" - fi - done - - echo "Set CPUFreq governor to [performance]" - i=0 - while [ $i != 9999 ] ; do - temp="` cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor 2>/dev/null`" - if [ "$temp" == "" ] ; then - i=9999 - else - echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor - let i=$i+1 - fi - done - fi - - mount -t debugfs none /sys/kernel/debug/ 2>/dev/null - get_uptime - FTRACE_START_MARKER=$RESULT - - echo "Start FTrace..." - $TRACE_CMD_EXE reset - $TRACE_CMD_EXE start -b $CONFIG_FTRACE_BUFFER_SIZE $CONFIG_FTRACE_EVENTS - echo $FTRACE_START_MARKER > /sys/kernel/debug/tracing/trace_marker - echo "Tracing started @ $FTRACE_START_MARKER" + BOOST_GOVERNOR=${1:-1} + + if [ $ANDROID -eq 1 ]; then + echo "Stop all android services" + stop + fi + + if [ $BOOST_GOVERNOR -eq 1 ]; then + echo "Save current CPUFreq governors configuration" + i=0 + FTRACE_OLD_GOV="" + while [ $i != 9999 ] ; do + temp="` cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor 2>/dev/null`" + if [ "$temp" == "" ] ; then + i=9999 + else + let i=$i+1 + FTRACE_OLD_GOV="$FTRACE_OLD_GOV $temp" + fi + done + + echo "Set CPUFreq governor to [performance]" + i=0 + while [ $i != 9999 ] ; do + temp="` cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor 2>/dev/null`" + if [ "$temp" == "" ] ; then + i=9999 + else + echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor + let i=$i+1 + fi + done + fi + + mount -t debugfs none /sys/kernel/debug/ 2>/dev/null + get_uptime + FTRACE_START_MARKER=$RESULT + + echo "Start FTrace..." + $TRACE_CMD_EXE reset + $TRACE_CMD_EXE start -b $CONFIG_FTRACE_BUFFER_SIZE $CONFIG_FTRACE_EVENTS + echo $FTRACE_START_MARKER > /sys/kernel/debug/tracing/trace_marker + echo "Tracing started @ $FTRACE_START_MARKER" } ftrace_stop() { - RESTORE_GOVERNOR=${1:-1} - - $TRACE_CMD_EXE stop - - get_uptime - ftrace_stop_start=$RESULT - echo "Tracing stopped" - - rm $FTRACE_FILE 2>/dev/null - if [ "$CONFIG_FTRACE_BINARY" == "n" ] ; then - echo "Extracting ASCII trace buffer..." - $TRACE_CMD_EXE show > $FTRACE_FILE 2>/dev/null - else - echo "Extracting BINARY trace buffer..." - $TRACE_CMD_EXE extract -o $FTRACE_FILE 2>/dev/null - fi - get_uptime - ftrace_extract_done=$RESULT - echo "Trace analysis from $ftrace_stop_start to $ftrace_extract_done" - - if [ $RESTORE_GOVERNOR -eq 1 ]; then - echo "Restore CPUFreq governors..." - i=0 - for value in $FTRACE_OLD_GOV ; do - echo $value > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor - let i=$i+1 - done - fi - - copy_trace_events + RESTORE_GOVERNOR=${1:-1} + + $TRACE_CMD_EXE stop + + get_uptime + ftrace_stop_start=$RESULT + echo "Tracing stopped" + + rm $FTRACE_FILE 2>/dev/null + if [ "$CONFIG_FTRACE_BINARY" == "n" ] ; then + echo "Extracting ASCII trace buffer..." + $TRACE_CMD_EXE show > $FTRACE_FILE 2>/dev/null + else + echo "Extracting BINARY trace buffer..." + $TRACE_CMD_EXE extract -o $FTRACE_FILE 2>/dev/null + fi + get_uptime + ftrace_extract_done=$RESULT + echo "Trace analysis from $ftrace_stop_start to $ftrace_extract_done" + + if [ $RESTORE_GOVERNOR -eq 1 ]; then + echo "Restore CPUFreq governors..." + i=0 + for value in $FTRACE_OLD_GOV ; do + echo $value > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor + let i=$i+1 + done + fi + + copy_trace_events } ftrace_check() { - get_uptime - ftrace_check_start=$RESULT - export TRACE_EVENTS_PATH - commandline="TRACE_EVENTS_PATH=$FTRACE_EVENTS" - export EXPECTED_TIME_IN_END_STATE_MS - commandline="$commandline EXPECTED_TIME_IN_END_STATE_MS=$EXPECTED_TIME_IN_END_STATE_MS" - export EXPECTED_CHANGE_TIME_MS_MIN - commandline="$commandline EXPECTED_CHANGE_TIME_MS_MIN=$EXPECTED_CHANGE_TIME_MS_MIN" - export EXPECTED_CHANGE_TIME_MS_MAX - commandline="$commandline EXPECTED_CHANGE_TIME_MS_MAX=$EXPECTED_CHANGE_TIME_MS_MAX" - export START_LITTLE - commandline="$commandline START_LITTLE=$START_LITTLE" - export START_LITTLE_PRIORITY - commandline="$commandline START_LITTLE_PRIORITY=$START_LITTLE_PRIORITY" - export START_BIG - commandline="$commandline START_BIG=$START_BIG" - export START_BIG_PRIORITY - commandline="$commandline START_BIG_PRIORITY=$START_BIG_PRIORITY" - export END_LITTLE - commandline="$commandline END_LITTLE=$END_LITTLE" - export END_LITTLE_PRIORITY - commandline="$commandline END_LITTLE_PRIORITY=$END_LITTLE_PRIORITY" - export END_BIG - commandline="$commandline END_BIG=$END_BIG" - export END_BIG_PRIORITY - commandline="$commandline END_BIG_PRIORITY=$END_BIG_PRIORITY" - export FTRACE_START_MARKER - commandline="$commandline FTRACE_START_MARKER=$FTRACE_START_MARKER" - export DISCARD_TIME_MS - commandline="$commandline DISCARD_TIME_MS=$DISCARD_TIME_MS" - export CPU_FAST - commandline="$commandline CPU_FAST=$CPU_FAST" - export CPU_SLOW - commandline="$commandline CPU_SLOW=$CPU_SLOW" - commandline="$commandline $FTRACE_ANALYZER_EXE -l $1 -t $FTRACE_FILE" - echo "# $commandline" - if [ "$CONFIG_FTRACE_BINARY" == "y" ] ; then - $TRACE_CMD_EXE report -i $FTRACE_FILE > trace.txt 2>/dev/null - $FTRACE_ANALYZER_EXE -l $1 -t trace.txt - RESULT0=$? - rm trace.txt - else - $FTRACE_ANALYZER_EXE -l $1 -t $FTRACE_FILE - RESULT0=$? - fi - get_uptime - ftrace_check_done=$RESULT - echo "Trace analysis run from $ftrace_check_start to $ftrace_check_done" - - # remove ftrace files if it was a success to limit - # space used on sdcard. - if [ "x$CONFIG_FTRACE_CLEANUP" == "xy" -a "$RESULT0" == "0" ] ; then - rm $FTRACE_FILE - else - gzip $FTRACE_FILE - fi - RESULT=$RESULT0 + get_uptime + ftrace_check_start=$RESULT + export TRACE_EVENTS_PATH + commandline="TRACE_EVENTS_PATH=$FTRACE_EVENTS" + export EXPECTED_TIME_IN_END_STATE_MS + commandline="$commandline EXPECTED_TIME_IN_END_STATE_MS=$EXPECTED_TIME_IN_END_STATE_MS" + export EXPECTED_CHANGE_TIME_MS_MIN + commandline="$commandline EXPECTED_CHANGE_TIME_MS_MIN=$EXPECTED_CHANGE_TIME_MS_MIN" + export EXPECTED_CHANGE_TIME_MS_MAX + commandline="$commandline EXPECTED_CHANGE_TIME_MS_MAX=$EXPECTED_CHANGE_TIME_MS_MAX" + export START_LITTLE + commandline="$commandline START_LITTLE=$START_LITTLE" + export START_LITTLE_PRIORITY + commandline="$commandline START_LITTLE_PRIORITY=$START_LITTLE_PRIORITY" + export START_BIG + commandline="$commandline START_BIG=$START_BIG" + export START_BIG_PRIORITY + commandline="$commandline START_BIG_PRIORITY=$START_BIG_PRIORITY" + export END_LITTLE + commandline="$commandline END_LITTLE=$END_LITTLE" + export END_LITTLE_PRIORITY + commandline="$commandline END_LITTLE_PRIORITY=$END_LITTLE_PRIORITY" + export END_BIG + commandline="$commandline END_BIG=$END_BIG" + export END_BIG_PRIORITY + commandline="$commandline END_BIG_PRIORITY=$END_BIG_PRIORITY" + export FTRACE_START_MARKER + commandline="$commandline FTRACE_START_MARKER=$FTRACE_START_MARKER" + export DISCARD_TIME_MS + commandline="$commandline DISCARD_TIME_MS=$DISCARD_TIME_MS" + export CPU_FAST + commandline="$commandline CPU_FAST=$CPU_FAST" + export CPU_SLOW + commandline="$commandline CPU_SLOW=$CPU_SLOW" + commandline="$commandline $FTRACE_ANALYZER_EXE -l $1 -t $FTRACE_FILE" + echo "# $commandline" + if [ "$CONFIG_FTRACE_BINARY" == "y" ] ; then + $TRACE_CMD_EXE report -i $FTRACE_FILE > trace.txt 2>/dev/null + $FTRACE_ANALYZER_EXE -l $1 -t trace.txt + RESULT0=$? + rm trace.txt + else + $FTRACE_ANALYZER_EXE -l $1 -t $FTRACE_FILE + RESULT0=$? + fi + get_uptime + ftrace_check_done=$RESULT + echo "Trace analysis run from $ftrace_check_start to $ftrace_check_done" + + # remove ftrace files if it was a success to limit + # space used on sdcard. + if [ "x$CONFIG_FTRACE_CLEANUP" == "xy" -a "$RESULT0" == "0" ] ; then + rm $FTRACE_FILE + else + gzip $FTRACE_FILE + fi + RESULT=$RESULT0 } get_task_pid() { - TRACE=$1 - TASK_NAME=$2 + TRACE=$1 + TASK_NAME=$2 - TASK=`awk -v PATTERN="$TASK_NAME-([0-9]+)" '$1 ~ PATTERN {print $1; exit 0;}' $TRACE` - TASK_PID=${TASK/${TASK_NAME}-/} + TASK=`awk -v PATTERN="$TASK_NAME-([0-9]+)" '$1 ~ PATTERN {print $1; exit 0;}' $TRACE` + TASK_PID=${TASK/${TASK_NAME}-/} - echo "Found task [$TASK_NAME] PID: $TASK_PID" - RESULT=$TASK_PID + echo "Found task [$TASK_NAME] PID: $TASK_PID" + RESULT=$TASK_PID } ftrace_check_tasks() { - get_uptime - export TRACE_TASKS - - # Generate TXT file required for analysis - if [ "$CONFIG_FTRACE_BINARY" == "y" ] ; then - $TRACE_CMD_EXE report -i $FTRACE_FILE > trace.txt 2>/dev/null - mv $FTRACE_FILE $FTRACE_FILE.bin - mv trace.txt $FTRACE_FILE - fi - - echo "Extracting tasks PIDs..." - for TASK in $TRACE_TASKS; do - get_task_pid $FTRACE_FILE $TASK - TASK_PID=$RESULT - PIDS+="$TASK_PID," - done - - echo "Computing CPUs usages for PIDs: $PIDS" - export PID=$PIDS - commandline="PID=$PID" - export CPUS_MASK - commandline="$commandline CPUS_MASK=$CPUS_MASK" - export USAGE_MIN - commandline="$commandline USAGE_MIN=$USAGE_MIN" - export USAGE_MAX - commandline="$commandline USAGE_MAX=$USAGE_MAX" - export TIME_MIN - commandline="$commandline TIME_MIN=$TIME_MIN" - export TIME_MAX - commandline="$commandline TIME_MAX=$TIME_MAX" - echo "# $commandline" - $FTRACE_ANALYZER_EXE -l libprocess_matrix.so.1.0.0 -t $FTRACE_FILE - RESULT0=$? - - # Recover original binary file - if [ "$CONFIG_FTRACE_BINARY" == "y" ] ; then - rm $FTRACE_FILE - mv $FTRACE_FILE.bin $FTRACE_FILE - fi - - # remove ftrace files if it was a success to limit - # space used on sdcard. - if [ "x$CONFIG_FTRACE_CLEANUP" == "xy" -a "$RESULT0" == "0" ] ; then - rm $FTRACE_FILE - else - gzip $FTRACE_FILE - fi - - # Return test result to testrunner - RESULT=$RESULT0 + get_uptime + export TRACE_TASKS + + # Generate TXT file required for analysis + if [ "$CONFIG_FTRACE_BINARY" == "y" ] ; then + $TRACE_CMD_EXE report -i $FTRACE_FILE > trace.txt 2>/dev/null + mv $FTRACE_FILE $FTRACE_FILE.bin + mv trace.txt $FTRACE_FILE + fi + + echo "Extracting tasks PIDs..." + for TASK in $TRACE_TASKS; do + get_task_pid $FTRACE_FILE $TASK + TASK_PID=$RESULT + PIDS+="$TASK_PID," + done + + echo "Computing CPUs usages for PIDs: $PIDS" + export PID=$PIDS + commandline="PID=$PID" + export CPUS_MASK + commandline="$commandline CPUS_MASK=$CPUS_MASK" + export USAGE_MIN + commandline="$commandline USAGE_MIN=$USAGE_MIN" + export USAGE_MAX + commandline="$commandline USAGE_MAX=$USAGE_MAX" + export TIME_MIN + commandline="$commandline TIME_MIN=$TIME_MIN" + export TIME_MAX + commandline="$commandline TIME_MAX=$TIME_MAX" + echo "# $commandline" + $FTRACE_ANALYZER_EXE -l libprocess_matrix.so.1.0.0 -t $FTRACE_FILE + RESULT0=$? + + # Recover original binary file + if [ "$CONFIG_FTRACE_BINARY" == "y" ] ; then + rm $FTRACE_FILE + mv $FTRACE_FILE.bin $FTRACE_FILE + fi + + # remove ftrace files if it was a success to limit + # space used on sdcard. + if [ "x$CONFIG_FTRACE_CLEANUP" == "xy" -a "$RESULT0" == "0" ] ; then + rm $FTRACE_FILE + else + gzip $FTRACE_FILE + fi + + # Return test result to testrunner + RESULT=$RESULT0 } diff --git a/Runner/utils/functestlib.sh b/Runner/utils/functestlib.sh index c255629..93d60c4 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -1,21 +1,20 @@ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause-Clear -# # Import test suite definitions . $(pwd)/init_env #import platform . $TOOLS/platform.sh -__RUNNER_SUITES_DIR="$(pwd)/suites" +__RUNNER_SUITES_DIR="/var/Runner/suites" __RUNNER_UTILS_BIN_DIR="/var/common" #This function used for test logging log() { local level="$1" - shift + shift # echo "$(date '+%Y-%m-%d %H:%M:%S') - $message" | tee -a /var/test_framework.log - echo "[$level] $(date '+%Y-%m-%d %H:%M:%S') - $*" | tee -a /var/test_output.log + echo "[$level] $(date '+%Y-%m-%d %H:%M:%S') - $*" | tee -a /var/test_output.log } # Find test case path by name find_test_case_by_name() { @@ -47,7 +46,7 @@ check_dependencies() { log_error "Exiting due to missing dependencies." exit 1 else - log_pass "Test related dependencies are present." + log_pass "Test related dependencies are present." fi } diff --git a/Runner/utils/platform.sh b/Runner/utils/platform.sh index 0251b4d..2c6d83d 100755 --- a/Runner/utils/platform.sh +++ b/Runner/utils/platform.sh @@ -4,11 +4,11 @@ # Detect Android userland ANDROID_PATH=/system/build.prop if [ -f $ANDROID_PATH ]; then - ANDROID=1 - SHELL_CMD=sh + ANDROID=1 + SHELL_CMD=sh else - ANDROID=0 - SHELL_CMD=bash + ANDROID=0 + SHELL_CMD=bash fi function pidkiller() From ae093704edc5dbc843233c3087a07320aedd7b24 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 13 May 2025 11:57:24 +0100 Subject: [PATCH 5/7] CPU frequency changes to support sh Made few changes for the script to work for sh. The previous change works for bash. Hence modified to work with sh Added back local variables as per review comment Signed-off-by: Vamsee Narapareddi --- .../baseport/CPUFreq_Validation/run.sh | 97 +++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh index b7a1a9d..2e594bd 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -4,8 +4,6 @@ #!/bin/sh . "$(pwd)/init_env" -# CPUFreq Validator: Parallel, Colorized -/var/Runner/init_env TESTNAME="CPUFreq_Validation" . "$TOOLS/functestlib.sh" @@ -14,120 +12,121 @@ log_info "---------------------------------------------------------------------- log_info "-------------------Starting $TESTNAME Testcase----------------------------" log_info "=== CPUFreq Frequency Walker with Validation ===" -# Color codes -GREEN="\e[32m" -RED="\e[31m" -YELLOW="\e[33m" -BLUE="\e[34m" -NC="\e[0m" # No Color +# Color codes (ANSI escape sequences) +GREEN="\033[32m" +RED="\033[31m" +YELLOW="\033[33m" +BLUE="\033[34m" +NC="\033[0m" NUM_CPUS=$(nproc) -echo -e "${YELLOW}Detected $NUM_CPUS CPU cores.${NC}" +printf "${YELLOW}Detected %s CPU cores.${NC}\n" "$NUM_CPUS" -overall_pass=true -declare -A core_status +overall_pass=0 +status_dir="/tmp/cpufreq_status.$$" +mkdir -p "$status_dir" validate_cpu_core() { local cpu=$1 local core_id=$2 + status_file="$status_dir/core_$core_id" - echo -e "${BLUE}Processing $cpu...${NC}" + printf "${BLUE}Processing %s...${NC}\n" "$cpu" if [ ! -d "$cpu/cpufreq" ]; then - echo -e "${BLUE}[SKIP]${NC} $cpu does not support cpufreq." - core_status["$core_id"]="skip" + printf "${BLUE}[SKIP]${NC} %s does not support cpufreq.\n" "$cpu" + echo "skip" > "$status_file" return fi available_freqs=$(cat "$cpu/cpufreq/scaling_available_frequencies" 2>/dev/null) if [ -z "$available_freqs" ]; then - echo -e "${YELLOW}[INFO]${NC} No available frequencies for $cpu. Skipping..." - core_status["$core_id"]="skip" + printf "${YELLOW}[INFO]${NC} No available frequencies for %s. Skipping...\n" "$cpu" + echo "skip" > "$status_file" return fi - # Set governor to userspace if echo "userspace" | tee "$cpu/cpufreq/scaling_governor" > /dev/null; then - echo -e "${YELLOW}[INFO]${NC} Set governor to userspace." + printf "${YELLOW}[INFO]${NC} Set governor to userspace.\n" else - echo -e "${RED}[ERROR]${NC} Cannot set userspace governor for $cpu." - core_status["$core_id"]="fail" + printf "${RED}[ERROR]${NC} Cannot set userspace governor for %s.\n" "$cpu" + echo "fail" > "$status_file" return fi - core_status["$core_id"]="pass" # Assume pass unless a failure happens + echo "pass" > "$status_file" for freq in $available_freqs; do log_info "Setting $cpu to frequency $freq kHz..." - if echo $freq | tee "$cpu/cpufreq/scaling_setspeed" > /dev/null; then + if echo "$freq" | tee "$cpu/cpufreq/scaling_setspeed" > /dev/null; then sleep 0.2 actual_freq=$(cat "$cpu/cpufreq/scaling_cur_freq") - if [ "$actual_freq" == "$freq" ]; then - echo -e "${GREEN}[PASS]${NC} $cpu set to $freq kHz." + if [ "$actual_freq" = "$freq" ]; then + printf "${GREEN}[PASS]${NC} %s set to %s kHz.\n" "$cpu" "$freq" else - echo -e "${RED}[FAIL]${NC} Tried to set $cpu to $freq kHz, but current is $actual_freq kHz." - core_status["$core_id"]="fail" + printf "${RED}[FAIL]${NC} Tried to set %s to %s kHz, but current is %s kHz.\n" "$cpu" "$freq" "$actual_freq" + echo "fail" > "$status_file" fi else - echo -e "${RED}[ERROR]${NC} Failed to set $cpu to $freq kHz." - core_status["$core_id"]="fail" + printf "${RED}[ERROR]${NC} Failed to set %s to %s kHz.\n" "$cpu" "$freq" + echo "fail" > "$status_file" fi done - # Restore governor echo "Restoring $cpu governor to 'ondemand'..." echo "ondemand" | sudo tee "$cpu/cpufreq/scaling_governor" > /dev/null } -# Launch validation per CPU in parallel cpu_index=0 for cpu in /sys/devices/system/cpu/cpu[0-9]*; do validate_cpu_core "$cpu" "$cpu_index" & - ((cpu_index++)) + cpu_index=$((cpu_index + 1)) done -# Wait for all background jobs to finish wait -# Summary log_info "" log_info "=== Per-Core Test Summary ===" -for idx in "${!core_status[@]}"; do - status=${core_status[$idx]} +for status_file in "$status_dir"/core_*; do + idx=$(basename "$status_file" | cut -d_ -f2) + status=$(cat "$status_file") case "$status" in pass) - echo -e "CPU$idx: ${GREEN}[PASS]${NC}" + printf "CPU%s: ${GREEN}[PASS]${NC}\n" "$idx" ;; fail) - echo -e "CPU$idx: ${RED}[FAIL]${NC}" - overall_pass=false + printf "CPU%s: ${RED}[FAIL]${NC}\n" "$idx" + overall_pass=1 ;; skip) - echo -e "CPU$idx: ${BLUE}[SKIPPED]${NC}" + printf "CPU%s: ${BLUE}[SKIPPED]${NC}\n" "$idx" ;; *) - echo -e "CPU$idx: ${RED}[UNKNOWN STATUS]${NC}" - overall_pass=false + printf "CPU%s: ${RED}[UNKNOWN STATUS]${NC}\n" "$idx" + overall_pass=1 ;; esac done -# Overall result log_info "" log_info "=== Overall CPUFreq Validation Result ===" -if $overall_pass; then - echo -e "${GREEN}[OVERALL PASS]${NC} All CPUs validated successfully." - log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res +if [ "$overall_pass" -eq 0 ]; then + printf "${GREEN}[OVERALL PASS]${NC} All CPUs validated successfully.\n" + log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res" + rm -r "$status_dir" exit 0 else - echo -e "${RED}[OVERALL FAIL]${NC} Some CPUs failed frequency validation." - log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res + printf "${RED}[OVERALL FAIL]${NC} Some CPUs failed frequency validation.\n" + log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" + rm -r "$status_dir" exit 1 +<<<<<<< HEAD fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" +======= +fi +>>>>>>> 7acac23 (CPU frequency changes to support sh) From 42e4f15007abb63b8646dc140a91be5fd4c00750 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:49:59 +0530 Subject: [PATCH 6/7] Removed unwanted functions from testcases Removed logging related functions at testcase level since it is duplicate code and already present in functestlib.sh Added functestlib.sh for IPA and RMNET as logging related functions log_pass/log_fail are defined in functestlib.sh Signed-off-by: Vamsee Narapareddi --- .../Kernel/FunctionalArea/baseport/IPA/run.sh | 19 +----------------- .../FunctionalArea/baseport/RMNET/run.sh | 20 +------------------ 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index 0ee1c01..2a51d03 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -5,24 +5,7 @@ # Import test suite definitions . $(pwd)/init_env TESTNAME="IPA" -#import test functions library -log() { - local level="$1" - shift - # echo "$(date '+%Y-%m-%d %H:%M:%S') - $message" | tee -a /var/test_framework.log - echo "[$level] $(/bin/date '+%Y-%m-%d %H:%M:%S') - $*" | /usr/bin/tee -a /var/test_output.log -} -# Find test case path by name -find_test_case_by_name() { - local test_name="$1" - find /var/Runner/suites -type d -name "$test_name" 2>/dev/null -} -# Logging levels -log_info() { log "INFO" "$@"; } -log_pass() { log "PASS" "$@"; } -log_fail() { log "FAIL" "$@"; } -log_error() { log "ERROR" "$@"; } - +. "$TOOLS/functestlib.sh" test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh index 4c95e87..4659790 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -5,25 +5,7 @@ # Import test suite definitions . $(pwd)/init_env TESTNAME="RMNET" - -#import test functions library -log() { - local level="$1" - shift - # echo "$(date '+%Y-%m-%d %H:%M:%S') - $message" | tee -a /var/test_framework.log - echo "[$level] $(/bin/date '+%Y-%m-%d %H:%M:%S') - $*" | /usr/bin/tee -a /var/test_output.log -} -# Find test case path by name -find_test_case_by_name() { - local test_name="$1" - find /var/Runner/suites -type d -name "$test_name" 2>/dev/null -} -# Logging levels -log_info() { log "INFO" "$@"; } -log_pass() { log "PASS" "$@"; } -log_fail() { log "FAIL" "$@"; } -log_error() { log "ERROR" "$@"; } - +. "$TOOLS/functestlib.sh" test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" From 31191574180911fdeb53ff48225f2a3ddf676c26 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 13 May 2025 12:05:07 +0100 Subject: [PATCH 7/7] Modified the PASS/FAIL result in all the scripts to work for LAVA Removed prev results Integrated LAVA framework with new YAML plans Added send-to-lava.sh script with SPDX license header Removed redundant variables in YAML files Integrated LAVA framework with new YAML plans Added send-to-lava.sh script with SPDX license header Removed redundant variables in YAML files This commit will remove few merge conflits Signed-off-by: Vamsee Narapareddi --- Runner/init_env | 2 +- .../Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh | 4 ---- Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh | 2 +- .../suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh | 2 +- 13 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Runner/init_env b/Runner/init_env index 44bc442..f37ed20 100755 --- a/Runner/init_env +++ b/Runner/init_env @@ -4,4 +4,4 @@ # Source this file to setup the test suite environment export BASEDIR=$(pwd) export TOOLS=$(pwd)/utils -export SUITES=$(pwd)/suites \ No newline at end of file +export SUITES=$(pwd)/suites diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh index 2e594bd..f2ed171 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -123,10 +123,6 @@ else echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" rm -r "$status_dir" exit 1 -<<<<<<< HEAD fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" -======= -fi ->>>>>>> 7acac23 (CPU frequency changes to support sh) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index e45f035..04e55ef 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -63,4 +63,4 @@ echo "$initial_count" | while read -r line; do echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi done -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index 2a51d03..ab423cf 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -31,4 +31,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh index 4a560e8..58c9b4a 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -60,4 +60,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh index 4659790..ee6197a 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -29,4 +29,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh index 19717e4..3c7cd31 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -28,4 +28,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh index ab2de35..7dd7e19 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -24,4 +24,4 @@ else log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh index eba8fbe..72b459c 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -27,4 +27,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh index fe873cc..6d6c86e 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -31,4 +31,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh index 19ef4f5..bfa74d2 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -29,4 +29,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh index d1079ac..655debc 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -23,4 +23,4 @@ else log_pass "$TESTNAME : Test Passed" echo "$TESTNAME PASS" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh index 9f5778e..bcac113 100755 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -41,4 +41,4 @@ else log_fail "$TESTNAME : Test Failed" echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res fi -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +log_info "-------------------Completed $TESTNAME Testcase----------------------------"