Skip to content

Commit db483d2

Browse files
authored
Merge branch 'qualcomm-linux:main' into main
2 parents d93e5e6 + 8e078f4 commit db483d2

File tree

44 files changed

+406
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+406
-425
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Enforce Script Executable Permissions
2+
3+
on:
4+
pull_request_target:
5+
branches: [ "main" ]
6+
paths:
7+
- '**/run.sh'
8+
- '**/*.sh'
9+
push:
10+
branches: [ "main" ]
11+
workflow_dispatch:
12+
13+
jobs:
14+
permissions:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Detect missing executable permissions on shell scripts
21+
run: |
22+
# Find all .sh and run.sh scripts without +x
23+
BAD=$(find . -type f \( -name "*.sh" -o -name "run.sh" \) ! -perm -u=x)
24+
if [ -n "$BAD" ]; then
25+
echo "::error file=run.sh,line=1::❌ Some shell scripts are missing executable permissions. This can break CI and LAVA. Please fix before merging."
26+
echo "::error file=run.sh,line=2::To fix, run: find . -name '*.sh' -o -name 'run.sh' | xargs chmod +x && git add . && git commit -m 'Fix: restore executable bits on scripts' && git push"
27+
echo ""
28+
echo "The following scripts need 'chmod +x':"
29+
echo "$BAD"
30+
# Output a PR annotation for each file
31+
echo "$BAD" | while read -r file; do
32+
echo "::error file=$file,line=1::$file is not executable. Please run: chmod +x $file && git add $file"
33+
done
34+
exit 1
35+
else
36+
echo "✅ All shell scripts have correct executable permissions."
37+
fi
38+
39+
- name: Detect accidental executables on non-shell files (optional, warning only)
40+
run: |
41+
# (Advanced/optional) Warn if any non-.sh file has +x (customize as needed)
42+
OTHER_EXEC=$(find . -type f ! -name '*.sh' ! -name 'run.sh' -perm -u=x)
43+
if [ -n "$OTHER_EXEC" ]; then
44+
echo "::warning file=run.sh,line=1::Warning: Non-shell files with executable permissions detected. Review if needed."
45+
echo "$OTHER_EXEC"
46+
fi

.github/workflows/preflight-checker-workflow.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ on:
66
branches: [ "main" ]
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
security-events: write
12+
913
jobs:
1014
checker:
1115
uses: qualcomm-linux/qli-actions/.github/workflows/multi-checker.yml@main
1216
with:
1317
repolinter: true # default: true
14-
semgrep: false # default: true
18+
semgrep: true # default: true
1519
copyright-license-detector: true # default: true
1620
pr-check-emails: true # default: true
1721

.github/workflows/shellcheck.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Shell Lint
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request_target:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "main" ]
8+
workflow_dispatch:
49

510
jobs:
611
shellcheck:

Runner/plans/qcom-next-ci-premerge.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,8 @@ run:
5252
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/storage/storage.res || true
5353
- $PWD/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh || true
5454
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/wpss_remoteproc.res || true
55+
- $PWD/suites/Kernel/FunctionalArea/DCVS/Freq_Scaling/run.sh || true
56+
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/DCVS/Freq_Scaling/Freq_Scaling.res || true
57+
- $PWD/suites/Kernel/FunctionalArea/Scheduler/CPU_affinity/run.sh || true
58+
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/FunctionalArea/Scheduler/CPU_affinity/CPU_affinity.res || true
5559
- $PWD/utils/result_parse.sh

Runner/run-test.sh

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ fi
3434
# Store results
3535
RESULTS_PASS=""
3636
RESULTS_FAIL=""
37+
RESULTS_SKIP=""
3738

3839
execute_test_case() {
3940
test_path=$1
@@ -43,20 +44,37 @@ execute_test_case() {
4344
run_script="$test_path/run.sh"
4445
if [ -f "$run_script" ]; then
4546
log "Executing test case: $test_name"
46-
if (cd "$test_path" && sh "./run.sh"); then
47-
log_pass "$test_name passed"
48-
if [ -z "$RESULTS_PASS" ]; then
49-
RESULTS_PASS="$test_name"
47+
(cd "$test_path" && sh "./run.sh")
48+
res_file="$test_path/$test_name.res"
49+
if [ -f "$res_file" ]; then
50+
if grep -q "SKIP" "$res_file"; then
51+
log_skip "$test_name skipped"
52+
if [ -z "$RESULTS_SKIP" ]; then
53+
RESULTS_SKIP="$test_name"
54+
else
55+
RESULTS_SKIP=$(printf "%s\n%s" "$RESULTS_SKIP" "$test_name")
56+
fi
57+
elif grep -q "PASS" "$res_file"; then
58+
log_pass "$test_name passed"
59+
if [ -z "$RESULTS_PASS" ]; then
60+
RESULTS_PASS="$test_name"
61+
else
62+
RESULTS_PASS=$(printf "%s\n%s" "$RESULTS_PASS" "$test_name")
63+
fi
64+
elif grep -q "FAIL" "$res_file"; then
65+
log_fail "$test_name failed"
66+
if [ -z "$RESULTS_FAIL" ]; then
67+
RESULTS_FAIL="$test_name"
68+
else
69+
RESULTS_FAIL=$(printf "%s\n%s" "$RESULTS_FAIL" "$test_name")
70+
fi
5071
else
51-
RESULTS_PASS=$(printf "%s\n%s" "$RESULTS_PASS" "$test_name")
72+
log_fail "$test_name: unknown result in .res file"
73+
RESULTS_FAIL=$(printf "%s\n%s" "$RESULTS_FAIL" "$test_name (unknown result)")
5274
fi
5375
else
54-
log_fail "$test_name failed"
55-
if [ -z "$RESULTS_FAIL" ]; then
56-
RESULTS_FAIL="$test_name"
57-
else
58-
RESULTS_FAIL=$(printf "%s\n%s" "$RESULTS_FAIL" "$test_name")
59-
fi
76+
log_fail "$test_name: .res file not found"
77+
RESULTS_FAIL=$(printf "%s\n%s" "$RESULTS_FAIL" "$test_name (.res not found)")
6078
fi
6179
else
6280
log_error "No run.sh found in $test_path"
@@ -95,6 +113,9 @@ print_summary() {
95113
echo
96114
echo "FAILED:"
97115
[ -n "$RESULTS_FAIL" ] && printf "%s\n" "$RESULTS_FAIL" || echo " None"
116+
echo
117+
echo "SKIPPED:"
118+
[ -n "$RESULTS_SKIP" ] && printf "%s\n" "$RESULTS_SKIP" || echo " None"
98119
log_info "=================================="
99120
}
100121

Runner/suites/Kernel/FunctionalArea/DCVS/Freq_Scaling/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ kill $LOAD_PID
8686
if [ "$CURRENT_FREQ" -gt "$MIN_FREQ" ]; then
8787
log_pass "DCVS scaling appears functional. Test Passed"
8888
echo "$TESTNAME PASS" > "$res_file"
89+
exit 0
8990
else
9091
log_fail "DCVS did not scale as expected. Test Failed"
9192
echo "$TESTNAME FAIL" > "$res_file"
93+
exit 1
9294
fi
9395

9496
log_info "----------- Completed $TESTNAME Test ------------"

Runner/suites/Kernel/FunctionalArea/Scheduler/CPU_affinity/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ log_info "-------- Starting $TESTNAME Functional Test --------"
3939

4040
check_dependencies taskset top chrt zcat grep
4141

42-
REQUIRED_CONFIGS="CONFIG_SCHED_DEBUG CONFIG_CGROUP_SCHED CONFIG_SMP"
42+
REQUIRED_CONFIGS="CONFIG_CGROUP_SCHED CONFIG_SMP"
4343
for config in $REQUIRED_CONFIGS; do
4444
if check_kernel_config "$config"; then
4545
log_pass "$config is enabled"
@@ -83,9 +83,11 @@ log_info "Scheduling Policy: $SCHED_POLICY"
8383
if echo "$SCHED_POLICY" | grep -q "SCHED_OTHER"; then
8484
log_pass "Default scheduling policy detected. Test passed"
8585
echo "$TESTNAME PASS" > "$res_file"
86+
exit 0
8687
else
8788
log_fail "Unexpected scheduling policy. Test Failed"
8889
echo "$TESTNAME FAIL" > "$res_file"
90+
exit 1
8991
fi
9092

9193
kill $TASK_PID

Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ done
8383
if $incremented; then
8484
log_pass "$TESTNAME : Test Passed"
8585
echo "$TESTNAME PASS" > "$res_file"
86+
exit 0
8687
else
8788
log_fail "$TESTNAME : Test Failed"
8889
echo "$TESTNAME FAIL" > "$res_file"
90+
exit 1
8991
fi
9092
log_info "-------------------Completed $TESTNAME Testcase----------------------------"

Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ output=$(i2c-msm-test -v -D /dev/i2c-0 -l | grep "ret:1")
4747
if echo "$output" | grep -q "Reading"; then
4848
log_pass "$TESTNAME : Test Passed"
4949
echo "$TESTNAME PASS" > "$res_file"
50+
exit 0
5051
else
5152
log_fail "$TESTNAME : Test Failed"
52-
echo "$TESTNAME FAIL" > "$res_file"
53+
echo "$TESTNAME FAIL" > "$res_file"
54+
exit 1
5355
fi
5456
log_info "-------------------Completed $TESTNAME Testcase----------------------------"

Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ log_info "=== Final Result ==="
109109
if [ "$overall_pass" -eq 0 ]; then
110110
log_pass "$TESTNAME: All policies passed"
111111
echo "$TESTNAME PASS" > "$res_file"
112+
exit 0
112113
else
113114
log_fail "$TESTNAME: One or more policies failed"
114115
echo "$TESTNAME FAIL" > "$res_file"
116+
exit 1
115117
fi
116118

117119
rm -rf "$status_dir"

0 commit comments

Comments
 (0)