From 978ade7bdbd55fa6bc17a8148460a94ad687f796 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:08:02 +0530 Subject: [PATCH 01/17] 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 Signed-off-by: Vamsee Narapareddi --- Runner/init_env | 13 +--- Runner/plans/AudioCI_PreMerge.yaml | 17 ++++++ Runner/plans/KernelCI_PreMerge.yaml | 55 +++++++++++++++++ Runner/plans/meta-qcom_PreMerge.yaml | 59 +++++++++++++++++++ .../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 | 4 +- .../FunctionalArea/baseport/MEMLAT/run.sh | 4 +- .../FunctionalArea/baseport/RMNET/run.sh | 4 +- .../baseport/Reboot_health_check/Readme.md | 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/send-to-lava.sh | 55 +++++++++++++++++ 31 files changed, 248 insertions(+), 64 deletions(-) create mode 100644 Runner/plans/AudioCI_PreMerge.yaml create mode 100644 Runner/plans/KernelCI_PreMerge.yaml create mode 100644 Runner/plans/meta-qcom_PreMerge.yaml mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/Readme.md mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh create mode 100644 Runner/utils/send-to-lava.sh diff --git a/Runner/init_env b/Runner/init_env index 82f5bd68..875489c8 100755 --- a/Runner/init_env +++ b/Runner/init_env @@ -1,11 +1,4 @@ # 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/AudioCI_PreMerge.yaml b/Runner/plans/AudioCI_PreMerge.yaml new file mode 100644 index 00000000..4c9f5632 --- /dev/null +++ b/Runner/plans/AudioCI_PreMerge.yaml @@ -0,0 +1,17 @@ +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 + - chmod -R 777 * \ No newline at end of file diff --git a/Runner/plans/KernelCI_PreMerge.yaml b/Runner/plans/KernelCI_PreMerge.yaml new file mode 100644 index 00000000..efa8a10a --- /dev/null +++ b/Runner/plans/KernelCI_PreMerge.yaml @@ -0,0 +1,55 @@ +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 + - chmod -R 777 * + - $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 \ No newline at end of file diff --git a/Runner/plans/meta-qcom_PreMerge.yaml b/Runner/plans/meta-qcom_PreMerge.yaml new file mode 100644 index 00000000..88b6a261 --- /dev/null +++ b/Runner/plans/meta-qcom_PreMerge.yaml @@ -0,0 +1,59 @@ +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 + - chmod -R 777 * + - $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 \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh old mode 100755 new mode 100644 index e1c7545a..6c2d5cb8 --- a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh @@ -51,9 +51,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 100755 new mode 100644 index 43c931ec..6738d856 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh @@ -18,9 +18,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 100755 new mode 100644 index 222201d3..4bca42ca --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -117,11 +117,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 100755 new mode 100644 index d9b3dde9..31b391c3 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -54,10 +54,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 100755 new mode 100644 index 48dd295c..359158c3 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -39,10 +39,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 100755 new mode 100644 index 338a48d9..dc979bec --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -15,9 +15,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 100755 new mode 100644 index 0d45a281..6be8d601 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -54,10 +54,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/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh old mode 100755 new mode 100644 index f756b155..9adf8a63 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -52,9 +52,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 100755 new mode 100644 index acd8316f..de7b879a --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -38,10 +38,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/Readme.md b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/Readme.md old mode 100755 new mode 100644 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 100755 new mode 100644 diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh old mode 100755 new mode 100644 index 45c2f8d4..d5d0c00d --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -20,9 +20,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 100755 new mode 100644 index 490256ac..2335e9ee --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -25,7 +25,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 @@ -37,7 +37,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" @@ -50,12 +50,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 100755 new mode 100644 index acb22368..4c4ad9ef --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -24,7 +24,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 @@ -35,7 +35,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" @@ -48,12 +48,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 100755 new mode 100644 index db14105c..ead76bd7 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -63,9 +63,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 100755 new mode 100644 index fea912f3..bb2b542d --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -15,9 +15,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 100755 new mode 100644 index 8c492287..d655f61a --- a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh @@ -51,10 +51,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 100755 new mode 100644 index 6a32128f..bfc70328 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -18,9 +18,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 100755 new mode 100644 index 8c717ffc..234930ce --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -16,9 +16,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 100755 new mode 100644 index 8dbdf987..33c21347 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -19,9 +19,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 100755 new mode 100644 index 1699501b..4e39c774 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -23,9 +23,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 100755 new mode 100644 index a1b1e73e..6fab5a0c --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -21,9 +21,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 100755 new mode 100644 index ee8ce1b5..9b13105a --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -15,9 +15,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 100755 new mode 100644 index fc479af2..60722b5b --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -20,22 +20,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 100755 new mode 100644 index 568ff5f3..0ef7b79b --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -12,10 +12,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 100755 new mode 100644 index 0af4dfa6..8cc5caa7 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -23,7 +23,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 @@ -34,7 +34,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" @@ -47,12 +47,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/send-to-lava.sh b/Runner/utils/send-to-lava.sh new file mode 100644 index 00000000..df5f22ef --- /dev/null +++ b/Runner/utils/send-to-lava.sh @@ -0,0 +1,55 @@ +#Copyright: 2016-2019 Linaro Limited +#SPDX-License-Identifier: GPL-2.0-only + +#!/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 ab2c76a06491c5f7a716523e83f9fb68fa14f7b3 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:23:19 +0530 Subject: [PATCH 02/17] 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 | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh | 4 ++-- .../FunctionalArea/baseport/CPUFreq_Validation/run.sh | 6 +++--- 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 ++-- .../suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh | 4 ++-- Runner/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 ++-- Runner/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 ++-- Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh | 4 ++-- Runner/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/utils/basics.sh | 2 +- Runner/utils/functestlib.sh | 4 ++-- 28 files changed, 53 insertions(+), 53 deletions(-) mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh diff --git a/Runner/run-test.sh b/Runner/run-test.sh index 3dc14ae0..a8867276 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -1,6 +1,6 @@ #!/bin/sh # Import test suite definitions -source /var/Runner/init_env +source $(pwd)/init_env #import test functions library source $TOOLS/functestlib.sh diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh index 6c2d5cb8..1f61fb7d 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh @@ -1,10 +1,10 @@ #!/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 6738d856..ceb509ad 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh @@ -1,10 +1,10 @@ #!/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 4bca42ca..af211205 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -1,11 +1,11 @@ -#!/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----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index 31b391c3..7b9b9e31 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -1,10 +1,10 @@ #!/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 359158c3..506644f8 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -1,6 +1,6 @@ #!/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 dc979bec..ff4f6783 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -1,10 +1,10 @@ #!/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 6be8d601..9cce7adb 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -1,10 +1,10 @@ #!/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 9adf8a63..2457b054 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -1,9 +1,9 @@ #!/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 de7b879a..f5af19a4 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -1,6 +1,6 @@ #!/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 old mode 100755 new mode 100644 index 9a185da4..5611eb19 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh @@ -1,9 +1,9 @@ #!/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 d5d0c00d..05b6e02f 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -1,10 +1,10 @@ #!/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 2335e9ee..f19066ba 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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 4c4ad9ef..b5c50e19 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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 ead76bd7..4da2c1a3 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -1,10 +1,10 @@ #!/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 bb2b542d..43ecf2ea 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -1,10 +1,10 @@ #!/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 d655f61a..1c8028af 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh @@ -1,10 +1,10 @@ #!/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 bfc70328..5784bc99 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -1,9 +1,9 @@ #!/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 234930ce..30dc0679 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -1,10 +1,10 @@ #!/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 33c21347..5b0a4173 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -1,10 +1,10 @@ #!/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 4e39c774..e2db703c 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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 6fab5a0c..dc76ced0 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -1,10 +1,10 @@ #!/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 9b13105a..85c46e91 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -1,10 +1,10 @@ #!/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 60722b5b..1582ec74 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -1,10 +1,10 @@ #!/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 0ef7b79b..47e4ccab 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -1,10 +1,10 @@ #!/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 8cc5caa7..40efd145 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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/utils/basics.sh b/Runner/utils/basics.sh index d0a35d66..cdd957eb 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -1,5 +1,5 @@ # Import test suite definitions -source ../../../../init_env +. $(pwd)/init_env #import platform . $TOOLS/platform.sh diff --git a/Runner/utils/functestlib.sh b/Runner/utils/functestlib.sh index 64db3503..b4da04b8 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -1,8 +1,8 @@ # # 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_UTILS_BIN_DIR="/var/common" From dfe35e1eb402f8c18d44da278060df61f43ece36 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:45:25 +0530 Subject: [PATCH 03/17] Modified the find command to identify the testcase Modified the find command Signed-off-by: Vamsee Narapareddi --- Runner/run-test.sh | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/Runner/run-test.sh b/Runner/run-test.sh index a8867276..d557b2c1 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -8,8 +8,34 @@ source $TOOLS/functestlib.sh # 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 + # local test_name="$1" + # dir= "." + # 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" + # Check if the run.sh file is present in the absolute path (ignoring case) + # if [ -f "$abs_path/run.sh" ]; then + # Print the absolute path of run.sh + # echo "Absolute path of run.sh: $abs_path/run.sh" + # fi + 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 @@ -35,8 +61,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 From a752a9e9a2cd3eef88d780fa2e65577fca9ca226 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:48:53 +0530 Subject: [PATCH 04/17] Fixed indentation in all shell scripts 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 | 14 +- .../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 | 10 +- Runner/utils/platform.sh | 8 +- 23 files changed, 322 insertions(+), 325 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index 7b9b9e31..d922c8ee 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -43,7 +43,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" @@ -51,13 +51,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 506644f8..d6c87fd4 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -37,12 +37,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 ff4f6783..0f77c4eb 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -17,7 +17,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 9cce7adb..e452ce2d 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -43,7 +43,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" @@ -51,13 +51,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/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh index 2457b054..8d25b89a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -54,7 +54,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 f5af19a4..86664e5a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -36,12 +36,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 05b6e02f..75ab564c 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -22,7 +22,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 f19066ba..7b08f25e 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -26,7 +26,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) @@ -36,11 +36,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) @@ -49,7 +49,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 b5c50e19..dadfd26f 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -25,7 +25,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) @@ -34,11 +34,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 4da2c1a3..e3ddc09f 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -15,16 +15,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 } @@ -64,9 +64,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 43ecf2ea..4dccc7ce 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -17,7 +17,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 5784bc99..7265a81b 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -19,10 +19,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 30dc0679..f1fb3535 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -18,7 +18,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 5b0a4173..2bfa13ac 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -21,7 +21,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 e2db703c..e05bcd4a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -25,7 +25,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 dc76ced0..843857d9 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -23,7 +23,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 85c46e91..2e43a6d0 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -17,7 +17,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 1582ec74..bd6344a4 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -35,7 +35,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 47e4ccab..62d9f089 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -14,8 +14,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 40efd145..5b142390 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -24,7 +24,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,7 +37,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 cdd957eb..12e4efa7 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -37,23 +37,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) @@ -84,89 +84,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. @@ -176,231 +176,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 b4da04b8..623d3792 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -1,18 +1,18 @@ -# +# # Import test suite definitions . $(pwd)/init_env #import platform . $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 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() { @@ -44,7 +44,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 4427a44f..e5b59bd3 100755 --- a/Runner/utils/platform.sh +++ b/Runner/utils/platform.sh @@ -1,11 +1,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 c8583eb813d6e75847ee275f5c988809aeb2f0dc Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:49:31 +0530 Subject: [PATCH 05/17] CPU frequency changes to support sh Signed-off-by: Vamsee Narapareddi --- .../baseport/CPUFreq_Validation/run.sh | 101 ++++++++---------- 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh index af211205..4958be45 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -1,8 +1,6 @@ #!/bin/sh . "$(pwd)/init_env" -# CPUFreq Validator: Parallel, Colorized -/var/Runner/init_env TESTNAME="CPUFreq_Validation" . "$TOOLS/functestlib.sh" @@ -11,120 +9,115 @@ 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 + cpu=$1 + 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 -fi - -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +fi \ No newline at end of file From 11301ab3e8657ec28e251742ee67d46a55d41fba Mon Sep 17 00:00:00 2001 From: smuppand Date: Tue, 6 May 2025 21:46:20 +0530 Subject: [PATCH 06/17] Removing source files in preparation for migration to external repository Signed-off-by: smuppand Signed-off-by: Vamsee Narapareddi --- .../Reboot_health_check}/setup_systemd.sh | 0 common/src/Reboot/Simple_reboot.c | 127 ------------------ common/src/Reboot/reboot_health_check.c | 124 ----------------- 3 files changed, 251 deletions(-) rename {common/src/Reboot => Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check}/setup_systemd.sh (100%) delete mode 100755 common/src/Reboot/Simple_reboot.c delete mode 100755 common/src/Reboot/reboot_health_check.c diff --git a/common/src/Reboot/setup_systemd.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh similarity index 100% rename from common/src/Reboot/setup_systemd.sh rename to Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh diff --git a/common/src/Reboot/Simple_reboot.c b/common/src/Reboot/Simple_reboot.c deleted file mode 100755 index ad1ebeab..00000000 --- a/common/src/Reboot/Simple_reboot.c +++ /dev/null @@ -1,127 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#define HEALTH_DIR "/var/reboot_health" -#define LOG_FILE "/var/reboot_health/reboot_health.log" -#define SERIAL_PORT "/dev/ttyS0" - -// Function to get the current timestamp -void get_timestamp(char *buffer, size_t size) { - time_t now = time(NULL); - struct tm *t = localtime(&now); - strftime(buffer, size, "%Y-%m-%d %H:%M:%S", t); -} - -// Function to log messages with a specified level -void log_message(const char *level, const char *message) { - char timestamp[64]; - get_timestamp(timestamp, sizeof(timestamp)); - - // Log to file - FILE *log = fopen(LOG_FILE, "a"); - if (log) { - fprintf(log, "[%s] [%s] %s\n", timestamp, level, message); - fclose(log); - } - - // Log to serial port (for visibility) - FILE *serial = fopen(SERIAL_PORT, "w"); - if (serial) { - fprintf(serial, "[%s] [%s] %s\n", timestamp, level, message); - fclose(serial); - } -} - -// Helper functions for logging -void log_info(const char *message) { log_message("INFO", message); } -void log_pass(const char *message) { log_message("PASS", message); } -void log_fail(const char *message) { log_message("FAIL", message); } -void log_error(const char *message) { log_message("ERROR", message); } - -// Check if the system has recently rebooted by reading uptime -void check_system_reboot() { - FILE *fp; - char buffer[128]; - unsigned long uptime = 0; - - fp = fopen("/proc/uptime", "r"); - if (fp == NULL) { - log_error("Failed to read /proc/uptime."); - exit(1); - } - fscanf(fp, "%s", buffer); - fclose(fp); - - uptime = strtol(buffer, NULL, 10); // Uptime in seconds - - if (uptime < 300) { // If uptime is less than 5 minutes, assume the system has rebooted recently - log_info("System has rebooted recently (uptime < 300 seconds)."); - } else { - log_info("System uptime is normal (no recent reboot detected)."); - } -} - -// Check if the system is running a valid shell (PID 1) -void check_shell_alive() { - FILE *fp = fopen("/proc/1/comm", "r"); - if (!fp) { - log_fail("Cannot open /proc/1/comm. System critical error."); - exit(1); - } - - char buf[64] = {0}; - if (!fgets(buf, sizeof(buf), fp)) { - fclose(fp); - log_fail("Failed to read PID 1 comm."); - exit(1); - } - fclose(fp); - - buf[strcspn(buf, "\n")] = 0; // Remove trailing newline - - if (strstr(buf, "init") || strstr(buf, "systemd") || strstr(buf, "busybox")) { - char msg[128]; - snprintf(msg, sizeof(msg), "Booted successfully with PID1 -> %s", buf); - log_pass(msg); // Log PASS - } else { - char msg[128]; - snprintf(msg, sizeof(msg), "Boot failed. Unexpected PID1: %s", buf); - log_fail(msg); // Log FAIL - - log_info("Attempting reboot now..."); - sync(); - reboot(RB_AUTOBOOT); - } -} - -// Create the directory if it doesn't exist -int create_directory_if_not_exists(const char *dir_path) { - struct stat st = {0}; - if (stat(dir_path, &st) == -1) { - if (mkdir(dir_path, 0755) == -1) { - log_error("Failed to create directory /var/reboot_health."); - return -1; - } - log_info("Created directory /var/reboot_health."); - } - return 0; -} - -int main() { - // Ensure the directory exists before proceeding - if (create_directory_if_not_exists(HEALTH_DIR) != 0) { - log_error("Exiting due to failure in creating directory."); - return 1; // Directory creation failed - } - - check_system_reboot(); // Check if the system has recently rebooted - check_shell_alive(); // Check if the system shell (PID 1) is alive and healthy - - log_info("Reboot health check completed."); - return 0; -} diff --git a/common/src/Reboot/reboot_health_check.c b/common/src/Reboot/reboot_health_check.c deleted file mode 100755 index a264c438..00000000 --- a/common/src/Reboot/reboot_health_check.c +++ /dev/null @@ -1,124 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define LOG_DIR "/var/reboot_health" -#define LOG_FILE "/var/reboot_health/reboot_health.log" -#define RESULT_FILE "/var/reboot_health/test_result.txt" // Separate result file for CI/CD - -// Function to check if the system rebooted (log file exists) -int check_system_rebooted() { - FILE *file = fopen(LOG_FILE, "r"); - if (file == NULL) { - return 0; // No log file means no reboot has occurred - } - fclose(file); - return 1; // Log file exists, system has rebooted -} - -// Function to log the result of the health check -void log_health_check(int status) { - FILE *log_file = fopen(LOG_FILE, "a"); - if (log_file == NULL) { - perror("Failed to open log file"); - exit(1); - } - - time_t now = time(NULL); - char *time_str = ctime(&now); - time_str[strlen(time_str) - 1] = '\0'; // Remove the newline character from ctime's output - - if (status) { - fprintf(log_file, "[%s] PASS: System rebooted successfully.\n", time_str); - } else { - fprintf(log_file, "[%s] FAIL: System did not reboot successfully.\n", time_str); - } - - fclose(log_file); -} - -// Function to write a result (PASS/FAIL) for CI/CD into a separate file -void write_result_for_cicd(int status) { - FILE *result_file = fopen(RESULT_FILE, "a"); - if (result_file == NULL) { - perror("Failed to open result file"); - exit(1); - } - - time_t now = time(NULL); - char *time_str = ctime(&now); - time_str[strlen(time_str) - 1] = '\0'; // Remove the newline character - - if (status) { - fprintf(result_file, "[%s] PASS\n", time_str); - } else { - fprintf(result_file, "[%s] FAIL\n", time_str); - } - - fclose(result_file); -} - -// Function to ensure the log directory exists -void create_log_directory() { - if (access(LOG_DIR, F_OK) == -1) { - if (mkdir(LOG_DIR, 0755) != 0) { - perror("Failed to create log directory"); - exit(1); - } - } -} - -// Function to check if the log and result files exist, create them if not -void ensure_files_exist() { - // Create log file if not exists - FILE *log_file = fopen(LOG_FILE, "a"); - if (log_file == NULL) { - perror("Failed to open log file"); - exit(1); - } - fclose(log_file); // Close after checking/creating the file - - // Create result file if not exists - FILE *result_file = fopen(RESULT_FILE, "w"); - if (result_file == NULL) { - perror("Failed to open result file"); - exit(1); - } - fclose(result_file); // Close after checking/creating the file -} - -// Watchdog timer simulation -void watchdog_timer() { - int counter = 0; - while (1) { - sleep(5); // Check every 5 seconds - - counter++; - - if (check_system_rebooted()) { - log_health_check(1); // Log success if system rebooted - write_result_for_cicd(1); // Write pass to CI/CD result file - break; // Exit the loop after success - } - - if (counter >= 12) { // Timeout after 1 minute - log_health_check(0); // Log failure if no reboot detected - write_result_for_cicd(0); // Write fail to CI/CD result file - break; // Exit the loop after failure - } - } -} - -int main() { - // Ensure the necessary directories and files exist - create_log_directory(); - ensure_files_exist(); - - // Start the watchdog timer - watchdog_timer(); - - return 0; -} From 2138225dca69e9c7a7bc829fc51825811074b4fe Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:49:59 +0530 Subject: [PATCH 07/17] Removed unwanted functions from testcases Signed-off-by: Vamsee Narapareddi --- .../Kernel/FunctionalArea/baseport/IPA/run.sh | 17 ----------------- .../FunctionalArea/baseport/RMNET/run.sh | 18 ------------------ 2 files changed, 35 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index d6c87fd4..e5225c8a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -2,23 +2,6 @@ # 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" "$@"; } test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh index 86664e5a..2f34d4bd 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -3,24 +3,6 @@ . $(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" "$@"; } - test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" From fdec95ceecbc0321dc94f4554c3ab085554afe50 Mon Sep 17 00:00:00 2001 From: smuppand Date: Fri, 9 May 2025 18:05:35 +0530 Subject: [PATCH 08/17] Update License to BSD-3-Clause-Clear This pull request updates the project's license to BSD-3-Clause-Clear. Replaced the existing license file with the new license file. Reason for Change The update ensures that our project complies with the latest legal requirements and aligns with our current licensing strategy. Signed-off-by: smuppand Signed-off-by: Vamsee Narapareddi --- LICENSE | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..b01fe3f3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,3 @@ +Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + +SPDX-License-Identifier: BSD-3-Clause-Clear From 78db545c812176580483a2ebb0176955c638aa6f Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Sat, 10 May 2025 09:53:29 +0530 Subject: [PATCH 09/17] Fixed rmnet and IPA script. Added functestlib.sh for IPA and RMNET Signed-off-by: Vamsee Narapareddi --- Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index e5225c8a..53f8b7b7 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -2,7 +2,7 @@ # Import test suite definitions . $(pwd)/init_env TESTNAME="IPA" - +. "$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 2f34d4bd..a858f0c1 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -2,7 +2,7 @@ # Import test suite definitions . $(pwd)/init_env TESTNAME="RMNET" - +. "$TOOLS/functestlib.sh" test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" From 2105d0c77709f78ffc57df7de061cd923a36abc9 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:08:02 +0530 Subject: [PATCH 10/17] 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 Signed-off-by: Vamsee Narapareddi --- Runner/init_env | 13 +--- Runner/plans/AudioCI_PreMerge.yaml | 17 ++++++ Runner/plans/KernelCI_PreMerge.yaml | 55 +++++++++++++++++ Runner/plans/meta-qcom_PreMerge.yaml | 59 +++++++++++++++++++ .../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 | 4 +- .../FunctionalArea/baseport/MEMLAT/run.sh | 4 +- .../FunctionalArea/baseport/RMNET/run.sh | 4 +- .../baseport/Reboot_health_check/Readme.md | 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/send-to-lava.sh | 55 +++++++++++++++++ 31 files changed, 248 insertions(+), 64 deletions(-) create mode 100644 Runner/plans/AudioCI_PreMerge.yaml create mode 100644 Runner/plans/KernelCI_PreMerge.yaml create mode 100644 Runner/plans/meta-qcom_PreMerge.yaml mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/Readme.md mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh create mode 100644 Runner/utils/send-to-lava.sh diff --git a/Runner/init_env b/Runner/init_env index 82f5bd68..875489c8 100755 --- a/Runner/init_env +++ b/Runner/init_env @@ -1,11 +1,4 @@ # 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/AudioCI_PreMerge.yaml b/Runner/plans/AudioCI_PreMerge.yaml new file mode 100644 index 00000000..4c9f5632 --- /dev/null +++ b/Runner/plans/AudioCI_PreMerge.yaml @@ -0,0 +1,17 @@ +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 + - chmod -R 777 * \ No newline at end of file diff --git a/Runner/plans/KernelCI_PreMerge.yaml b/Runner/plans/KernelCI_PreMerge.yaml new file mode 100644 index 00000000..efa8a10a --- /dev/null +++ b/Runner/plans/KernelCI_PreMerge.yaml @@ -0,0 +1,55 @@ +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 + - chmod -R 777 * + - $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 \ No newline at end of file diff --git a/Runner/plans/meta-qcom_PreMerge.yaml b/Runner/plans/meta-qcom_PreMerge.yaml new file mode 100644 index 00000000..88b6a261 --- /dev/null +++ b/Runner/plans/meta-qcom_PreMerge.yaml @@ -0,0 +1,59 @@ +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 + - chmod -R 777 * + - $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 \ No newline at end of file diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh old mode 100755 new mode 100644 index e1c7545a..6c2d5cb8 --- a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh @@ -51,9 +51,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 100755 new mode 100644 index 43c931ec..6738d856 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh @@ -18,9 +18,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 100755 new mode 100644 index 222201d3..4bca42ca --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -117,11 +117,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 100755 new mode 100644 index d9b3dde9..31b391c3 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -54,10 +54,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 100755 new mode 100644 index 48dd295c..359158c3 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -39,10 +39,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 100755 new mode 100644 index 338a48d9..dc979bec --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -15,9 +15,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 100755 new mode 100644 index 0d45a281..6be8d601 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -54,10 +54,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/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh old mode 100755 new mode 100644 index f756b155..9adf8a63 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -52,9 +52,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 100755 new mode 100644 index acd8316f..de7b879a --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -38,10 +38,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/Readme.md b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/Readme.md old mode 100755 new mode 100644 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 100755 new mode 100644 diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh old mode 100755 new mode 100644 index 45c2f8d4..d5d0c00d --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -20,9 +20,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 100755 new mode 100644 index 490256ac..2335e9ee --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -25,7 +25,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 @@ -37,7 +37,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" @@ -50,12 +50,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 100755 new mode 100644 index acb22368..4c4ad9ef --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -24,7 +24,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 @@ -35,7 +35,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" @@ -48,12 +48,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 100755 new mode 100644 index db14105c..ead76bd7 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -63,9 +63,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 100755 new mode 100644 index fea912f3..bb2b542d --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -15,9 +15,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 100755 new mode 100644 index 8c492287..d655f61a --- a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh @@ -51,10 +51,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 100755 new mode 100644 index 6a32128f..bfc70328 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -18,9 +18,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 100755 new mode 100644 index 8c717ffc..234930ce --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -16,9 +16,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 100755 new mode 100644 index 8dbdf987..33c21347 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -19,9 +19,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 100755 new mode 100644 index 1699501b..4e39c774 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -23,9 +23,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 100755 new mode 100644 index a1b1e73e..6fab5a0c --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -21,9 +21,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 100755 new mode 100644 index ee8ce1b5..9b13105a --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -15,9 +15,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 100755 new mode 100644 index fc479af2..60722b5b --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -20,22 +20,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 100755 new mode 100644 index 568ff5f3..0ef7b79b --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -12,10 +12,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 100755 new mode 100644 index 0af4dfa6..8cc5caa7 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -23,7 +23,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 @@ -34,7 +34,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" @@ -47,12 +47,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/send-to-lava.sh b/Runner/utils/send-to-lava.sh new file mode 100644 index 00000000..df5f22ef --- /dev/null +++ b/Runner/utils/send-to-lava.sh @@ -0,0 +1,55 @@ +#Copyright: 2016-2019 Linaro Limited +#SPDX-License-Identifier: GPL-2.0-only + +#!/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 dfea5c2af5a2ae1e760f10c57ae4b4613836b780 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:23:19 +0530 Subject: [PATCH 11/17] 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 | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh | 4 ++-- .../FunctionalArea/baseport/CPUFreq_Validation/run.sh | 6 +++--- 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 ++-- .../suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh | 4 ++-- Runner/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 ++-- Runner/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 ++-- Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh | 4 ++-- .../suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh | 4 ++-- Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh | 4 ++-- Runner/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/utils/basics.sh | 2 +- Runner/utils/functestlib.sh | 4 ++-- 28 files changed, 53 insertions(+), 53 deletions(-) mode change 100755 => 100644 Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh diff --git a/Runner/run-test.sh b/Runner/run-test.sh index 3dc14ae0..a8867276 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -1,6 +1,6 @@ #!/bin/sh # Import test suite definitions -source /var/Runner/init_env +source $(pwd)/init_env #import test functions library source $TOOLS/functestlib.sh diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh index 6c2d5cb8..1f61fb7d 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh @@ -1,10 +1,10 @@ #!/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 6738d856..ceb509ad 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh @@ -1,10 +1,10 @@ #!/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 4bca42ca..af211205 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -1,11 +1,11 @@ -#!/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----------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index 31b391c3..7b9b9e31 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -1,10 +1,10 @@ #!/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 359158c3..506644f8 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -1,6 +1,6 @@ #!/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 dc979bec..ff4f6783 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -1,10 +1,10 @@ #!/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 6be8d601..9cce7adb 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -1,10 +1,10 @@ #!/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 9adf8a63..2457b054 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -1,9 +1,9 @@ #!/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 de7b879a..f5af19a4 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -1,6 +1,6 @@ #!/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 old mode 100755 new mode 100644 index 9a185da4..5611eb19 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/run.sh @@ -1,9 +1,9 @@ #!/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 d5d0c00d..05b6e02f 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -1,10 +1,10 @@ #!/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 2335e9ee..f19066ba 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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 4c4ad9ef..b5c50e19 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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 ead76bd7..4da2c1a3 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -1,10 +1,10 @@ #!/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 bb2b542d..43ecf2ea 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -1,10 +1,10 @@ #!/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 d655f61a..1c8028af 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh @@ -1,10 +1,10 @@ #!/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 bfc70328..5784bc99 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -1,9 +1,9 @@ #!/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 234930ce..30dc0679 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -1,10 +1,10 @@ #!/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 33c21347..5b0a4173 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -1,10 +1,10 @@ #!/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 4e39c774..e2db703c 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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 6fab5a0c..dc76ced0 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -1,10 +1,10 @@ #!/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 9b13105a..85c46e91 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -1,10 +1,10 @@ #!/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 60722b5b..1582ec74 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -1,10 +1,10 @@ #!/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 0ef7b79b..47e4ccab 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -1,10 +1,10 @@ #!/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 8cc5caa7..40efd145 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -1,10 +1,10 @@ #!/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/utils/basics.sh b/Runner/utils/basics.sh index d0a35d66..cdd957eb 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -1,5 +1,5 @@ # Import test suite definitions -source ../../../../init_env +. $(pwd)/init_env #import platform . $TOOLS/platform.sh diff --git a/Runner/utils/functestlib.sh b/Runner/utils/functestlib.sh index 64db3503..b4da04b8 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -1,8 +1,8 @@ # # 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_UTILS_BIN_DIR="/var/common" From 4a49520ad10e70a54cd25fb49e13c1cf5d9b0b74 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:45:25 +0530 Subject: [PATCH 12/17] 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 Signed-off-by: Vamsee Narapareddi --- Runner/run-test.sh | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/Runner/run-test.sh b/Runner/run-test.sh index a8867276..d557b2c1 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -8,8 +8,34 @@ source $TOOLS/functestlib.sh # 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 + # local test_name="$1" + # dir= "." + # 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" + # Check if the run.sh file is present in the absolute path (ignoring case) + # if [ -f "$abs_path/run.sh" ]; then + # Print the absolute path of run.sh + # echo "Absolute path of run.sh: $abs_path/run.sh" + # fi + 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 @@ -35,8 +61,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 From 9238e045e5142ecab3212b62117c26ca76d2e8fa Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:48:53 +0530 Subject: [PATCH 13/17] Fixed indentation in all shell scripts I have fixed all the indentation issues in all shell scripts 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 | 14 +- .../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 | 10 +- Runner/utils/platform.sh | 8 +- 23 files changed, 322 insertions(+), 325 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh index 7b9b9e31..d922c8ee 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh @@ -43,7 +43,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" @@ -51,13 +51,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 506644f8..d6c87fd4 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -37,12 +37,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 ff4f6783..0f77c4eb 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh @@ -17,7 +17,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 9cce7adb..e452ce2d 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh @@ -43,7 +43,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" @@ -51,13 +51,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/MEMLAT/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh index 2457b054..8d25b89a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh @@ -54,7 +54,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 f5af19a4..86664e5a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -36,12 +36,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 05b6e02f..75ab564c 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh @@ -22,7 +22,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 f19066ba..7b08f25e 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/adsp_remoteproc/run.sh @@ -26,7 +26,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) @@ -36,11 +36,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) @@ -49,7 +49,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 b5c50e19..dadfd26f 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/cdsp_remoteproc/run.sh @@ -25,7 +25,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) @@ -34,11 +34,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 4da2c1a3..e3ddc09f 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh @@ -15,16 +15,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 } @@ -64,9 +64,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 43ecf2ea..4dccc7ce 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh @@ -17,7 +17,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 5784bc99..7265a81b 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh @@ -19,10 +19,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 30dc0679..f1fb3535 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh @@ -18,7 +18,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 5b0a4173..2bfa13ac 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh @@ -21,7 +21,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 e2db703c..e05bcd4a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh @@ -25,7 +25,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 dc76ced0..843857d9 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh @@ -23,7 +23,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 85c46e91..2e43a6d0 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh @@ -17,7 +17,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 1582ec74..bd6344a4 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh @@ -35,7 +35,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 47e4ccab..62d9f089 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh @@ -14,8 +14,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 40efd145..5b142390 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh @@ -24,7 +24,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,7 +37,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 cdd957eb..12e4efa7 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -37,23 +37,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) @@ -84,89 +84,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. @@ -176,231 +176,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 b4da04b8..623d3792 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -1,18 +1,18 @@ -# +# # Import test suite definitions . $(pwd)/init_env #import platform . $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 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() { @@ -44,7 +44,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 4427a44f..e5b59bd3 100755 --- a/Runner/utils/platform.sh +++ b/Runner/utils/platform.sh @@ -1,11 +1,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 7acac2323fc30c63a173a01832780f8ad7419c0e Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:49:31 +0530 Subject: [PATCH 14/17] CPU frequency changes to support sh made few changes for the script to work for sh, previously added to work with bash Signed-off-by: Vamsee Narapareddi --- .../baseport/CPUFreq_Validation/run.sh | 101 ++++++++---------- 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh index af211205..4958be45 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh @@ -1,8 +1,6 @@ #!/bin/sh . "$(pwd)/init_env" -# CPUFreq Validator: Parallel, Colorized -/var/Runner/init_env TESTNAME="CPUFreq_Validation" . "$TOOLS/functestlib.sh" @@ -11,120 +9,115 @@ 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 + cpu=$1 + 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 -fi - -log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file +fi \ No newline at end of file From 619c57cda70bcea2dca3cb7f00b9e590c35a2d73 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 22:49:59 +0530 Subject: [PATCH 15/17] Removed unwanted functions from testcases Removed logging related functions as they are already present in functestlib.sh Signed-off-by: Vamsee Narapareddi --- .../Kernel/FunctionalArea/baseport/IPA/run.sh | 17 ----------------- .../FunctionalArea/baseport/RMNET/run.sh | 18 ------------------ 2 files changed, 35 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index d6c87fd4..e5225c8a 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -2,23 +2,6 @@ # 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" "$@"; } test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh index 86664e5a..2f34d4bd 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -3,24 +3,6 @@ . $(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" "$@"; } - test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" From 0cb15c1ba1cb382be5afb2ac88601e58f1ee1c54 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Sat, 10 May 2025 09:53:29 +0530 Subject: [PATCH 16/17] Fixed rmnet and IPA script. Added functestlib.sh for IPA and RMNET as log_pass/log_fail are define there Signed-off-by: Vamsee Narapareddi --- Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh | 2 +- Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh index e5225c8a..53f8b7b7 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh @@ -2,7 +2,7 @@ # Import test suite definitions . $(pwd)/init_env TESTNAME="IPA" - +. "$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 2f34d4bd..a858f0c1 100644 --- a/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh +++ b/Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh @@ -2,7 +2,7 @@ # Import test suite definitions . $(pwd)/init_env TESTNAME="RMNET" - +. "$TOOLS/functestlib.sh" test_path=$(find_test_case_by_name "$TESTNAME") log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" From 6b5cb3ca364491c9907e498ee50a995214883569 Mon Sep 17 00:00:00 2001 From: Vamsee Narapareddi Date: Mon, 12 May 2025 23:24:22 +0530 Subject: [PATCH 17/17] Removed source Signed-off-by: Vamsee Narapareddi --- Runner/run-test.sh | 4 ++-- Runner/suites/Multimedia/DSP_AudioPD/run.sh | 2 +- Runner/suites/Multimedia/Graphics/run.sh | 2 +- Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh | 2 +- Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh | 2 +- Runner/utils/basics.sh | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Runner/run-test.sh b/Runner/run-test.sh index d557b2c1..065b27b4 100755 --- a/Runner/run-test.sh +++ b/Runner/run-test.sh @@ -1,9 +1,9 @@ #!/bin/sh # Import test suite definitions -source $(pwd)/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/Multimedia/DSP_AudioPD/run.sh b/Runner/suites/Multimedia/DSP_AudioPD/run.sh index e6ad2ffc..a94ea886 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 031d882d..f7f96f63 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 0990bb13..68be7d65 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 239129dc..ee63ef4f 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 12e4efa7..ff1b4677 100755 --- a/Runner/utils/basics.sh +++ b/Runner/utils/basics.sh @@ -5,7 +5,7 @@ . $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