Skip to content

Commit f9dcaec

Browse files
fanchen2laifryiee
authored andcommitted
BM/FRED: Case improvement
Remove kernel cmdline case, add kernel cmdline check in each case. Add Kconfig test case Signed-off-by: Farrah Chen <farrah.chen@intel.com>
1 parent e10d656 commit f9dcaec

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

BM/fred/fred_test.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,33 @@ __EOF
1919
}
2020

2121
###################### Functions ######################
22+
# Check if FRED is enabled in Kernel config
23+
kconfig_test() {
24+
general_test.sh -t kconfig -k "CONFIG_X86_FRED=y" || ret=1
25+
[ $ret -eq 0 ] || die "CONFIG_X86_FRED=y is not set in Kconfig, FRED is not enabled"
26+
}
27+
2228
# Check this cpu could support the function which contain the parameter
2329
# $1: Parameter should be support in cpuinfo
2430
# Return: 0 for true, otherwise false
2531
cpu_info_check() {
32+
do_cmd "grep -q 'fred=on' '/proc/cmdline'"
2633
local cpu_func=$1
2734
[ -n "$cpu_func" ] || die "cpu info check name is null:$cpu_func"
2835
grep -q "$cpu_func" /proc/cpuinfo || block_test "CPU not support:$cpu_func"
2936
test_print_trc "/proc/cpuinfo contain '$cpu_func'"
3037
return 0
3138
}
3239

33-
# Cmdline test: Verify if FRED is enabled in kernel cmdline
34-
cmdline_test() {
35-
do_cmd "grep -q 'fred=on' '/proc/cmdline'"
36-
}
37-
3840
# Dmesg test: Verify if FRED is initialized
3941
dmesg_test() {
42+
do_cmd "grep -q 'fred=on' '/proc/cmdline'"
4043
do_cmd "dmesg | grep 'Initialize FRED on CPU'"
4144
}
4245

4346
# CPUID test: Check FRED CPUID
4447
cpuid_test() {
48+
do_cmd "grep -q 'fred=on' '/proc/cmdline'"
4549
#CPUID.0x7.1.EAX[17] == 1
4650
do_cmd "cpuid_check 7 0 1 0 a 17"
4751
}
@@ -54,13 +58,14 @@ lkgs_cpuid_test() {
5458

5559
# CPUINFO test: Check FRED cpu flag in cpu info
5660
cpuinfo_test() {
61+
do_cmd "grep -q 'fred=on' '/proc/cmdline'"
5762
do_cmd "cpu_info_check fred"
5863
}
5964

6065
fred_test() {
6166
case $TEST_SCENARIO in
62-
cmdline)
63-
cmdline_test
67+
kconfig)
68+
kconfig_test
6469
;;
6570
dmesg)
6671
dmesg_test

BM/fred/tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file collects the FRED cases
22
# @hw_dep: cpuid_check 7 0 1 0 a 17 @ CPU doesn't support FRED CPUID.(EAX=07H,ECX=01H):EAX[bit 17]
33
# @other_dep: general_test.sh -t kconfig -k "CONFIG_X86_FRED=y" @ No kconfig CONFIG_X86_FRED=y
4-
fred_test.sh -t cmdline
4+
fred_test.sh -t kconfig
55
fred_test.sh -t dmesg
66
fred_test.sh -t cpuid
77
fred_test.sh -t cpuinfo

0 commit comments

Comments
 (0)