-
Notifications
You must be signed in to change notification settings - Fork 17
Added Kernel Level testcases #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
exit 1 | ||
fi | ||
done | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better move this logic to functestlib.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved his function to functestlib.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move DCVS out of baseport and create under FunctionaArea
fi | ||
return 0 | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be moved to functestlib.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved his function to functestlib.sh
return 0 | ||
} | ||
|
||
check_dt_nodes() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be moved to functestlib.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved his function to functestlib.sh
return 1 | ||
} | ||
|
||
check_driver_loaded() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also can be moved to functestlib.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to functestlib.sh
f495f75
to
2322190
Compare
@@ -48,6 +48,17 @@ find_test_case_script_by_name() { | |||
find "$base_dir" -type d -iname "$test_name" -print -quit 2>/dev/null | |||
} | |||
|
|||
check_kernel_config() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some Improvements can be done.
-
Add ; or line breaks for POSIX shell between statements.
-
Always quote variables in command substitutions.
-
Use return 1 right after logging failure, and only one return at the end.
-
Good idea to log both PASS and FAIL for clear CI visibility.
-
if you want it extended for “=m” (module) configs as well!
7cdfdbe
to
f6f346e
Compare
check_kernel_config "CONFIG_IOMMU_SUPPORT" || pass=false | ||
check_kernel_config "CONFIG_QCOM_IOMMU" || pass=false | ||
check_kernel_config "CONFIG_ARM_SMMU" || pass=false | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with a loop for easier maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this and added loops
06f8566
to
82a7c2c
Compare
|
||
CONFIGS="CONFIG_IOMMU_SUPPORT CONFIG_QCOM_IOMMU CONFIG_ARM_SMMU" | ||
check_kernel_config "$CONFIGS" || { | ||
log_fail "Device tree validation failed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you are loging wrong statement. Please correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated log statement
} | ||
LOADED_MODULES="msm_iommu arm_smmu" | ||
check_driver_loaded "$LOADED_MODULES" || { | ||
log_fail "Device tree validation failed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the log statement according to the modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated log statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor changes. Rest LGTM.
|
||
|
||
check_kernel_config CONFIG_CPU_FREQ CONFIG_CPU_FREQ_GOV_SCHEDUTIL CONFIG_CPU_FREQ_GOV_PERFORMANCE | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add checks similar to IOMMU test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the required checks
|
||
check_kernel_config CONFIG_CPU_FREQ CONFIG_CPU_FREQ_GOV_SCHEDUTIL CONFIG_CPU_FREQ_GOV_PERFORMANCE | ||
|
||
CPUFREQ_PATH="/sys/devices/system/cpu/cpu0/cpufreq" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to check for all cpu* instead only cpu0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added logic to check for all CPUs
echo "$TESTNAME PASS" > "$res_file" | ||
else | ||
log_fail "Failed to set CPU affinity" | ||
echo "$TESTNAME FAIL" > "$test_path"/$TESTNAME.res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better main consistency of logging across the scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated logging
echo "$TESTNAME PASS" > "$res_file" | ||
else | ||
log_fail "Unexpected scheduling policy. Test Failed" | ||
echo "$TESTNAME FAIL" > "$test_path"/$TESTNAME.res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better main consistency of logging across the scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated logging
@@ -0,0 +1,37 @@ | |||
# IOMMU Validation Test | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test name is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated test name
@@ -0,0 +1,37 @@ | |||
# IOMMU Validation Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document title it wrong, it should be scheduler instead of IOMMU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated title
@smuppand all comments fixed now |
CPUFREQ_BASE_PATH="/sys/devices/system/cpu" | ||
i=0 | ||
|
||
while [ "$i" -le 7 ]; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to make this function generic and target-agnostic. So it works on any number of cpus/cores across the platforms.
- Dynamically enumerate CPUs from /sys/devices/system/cpu/ (look for cpu[0-9]* directories).
- Iterate over these directories to check for cpufreq presence.
- Fail only if at least one CPU should support CPUFreq but doesn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
log_info "CPU frequency range: $MIN_FREQ - $MAX_FREQ" | ||
|
||
log_info "Triggering frequency update via governor" | ||
cat /dev/urandom | head -c 1000M > /dev/null & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not the best or most idiomatic way to use of cat. Instead use head -c 1000M /dev/urandom > /dev/null &
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated command with dd if=/dev/urandom of=/dev/null bs=1M count=1000 &
|
||
log_info "Creating a CPU-bound background task..." | ||
cpu_task() { | ||
while :; do :; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loop while :; do :; done is fine for an infinite loop, but it may be more readable as while true; do :; done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified as suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last commit with common functions should be moved to be the 1st commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase your feature branch on top of the latest main. This makes the PR earier to review and merge.
This commit is to add check_kernel_config function in common functions This function will check if the corresponding configs are enabled in /proc/config.gz Added check_driver_loaded to check if any driver is loaded. Added check_dt_nodes to check if DT nodes are present Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
This testcase vaildates configs like CONFIG_CPU_FREQ CONFIG_CPU_FREQ_GOV_SCHEDUTIL CONFIG_CPU_FREQ_GOV_PERFORMANCE and checks cpu frequencies` before and after a load is applied Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
This test validates the Scheduler support by checking corresponding SCHED configs and checks cpu affinity by creating a CPU-bound background task Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
This test validates the IOMMU (Input-Output Memory Management Unit) support by checking IOMMU configs and checks if the corresponding drivers are loaded instead of just checking the dmesg logs. Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Added the below testcases