diff mbox series

[2/3] selftests: cpufreq: Add wapper script for test AMD P-State

Message ID 20220413090510.4039589-3-li.meng@amd.com
State New
Headers show
Series Add unit test module for AMD P-State driver | expand

Commit Message

Meng, Li (Jassmine) April 13, 2022, 9:05 a.m. UTC
Adds a wrapper shell script for the amd_pstate_testmod module.

Signed-off-by: Meng Li <li.meng@amd.com>
---
 tools/testing/selftests/cpufreq/Makefile              | 2 +-
 tools/testing/selftests/cpufreq/amd_pstate_testmod.sh | 4 ++++
 tools/testing/selftests/cpufreq/config                | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100755 tools/testing/selftests/cpufreq/amd_pstate_testmod.sh

Comments

Nathan Fontenot April 13, 2022, 7:55 p.m. UTC | #1
On 4/13/22 04:05, Meng Li wrote:
> Adds a wrapper shell script for the amd_pstate_testmod module.
> 
> Signed-off-by: Meng Li <li.meng@amd.com>
> ---
>  tools/testing/selftests/cpufreq/Makefile              | 2 +-
>  tools/testing/selftests/cpufreq/amd_pstate_testmod.sh | 4 ++++
>  tools/testing/selftests/cpufreq/config                | 1 +
>  3 files changed, 6 insertions(+), 1 deletion(-)
>  create mode 100755 tools/testing/selftests/cpufreq/amd_pstate_testmod.sh
> 
> diff --git a/tools/testing/selftests/cpufreq/Makefile b/tools/testing/selftests/cpufreq/Makefile
> index c86ca8342222..c32adc59a1f4 100644
> --- a/tools/testing/selftests/cpufreq/Makefile
> +++ b/tools/testing/selftests/cpufreq/Makefile
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
>  all:
>  
> -TEST_PROGS := main.sh
> +TEST_PROGS := main.sh amd_pstate_testmod.sh

Instead of making the amd-pstate testing a separate test program, should this
be part of the main.sh testing program?

Perhaps adding a "driver" test function that can check for the amd-pstate driver
being in use and run the test module.

-Nathan

>  TEST_FILES := cpu.sh cpufreq.sh governor.sh module.sh special-tests.sh
>  
>  include ../lib.mk
> diff --git a/tools/testing/selftests/cpufreq/amd_pstate_testmod.sh b/tools/testing/selftests/cpufreq/amd_pstate_testmod.sh
> new file mode 100755
> index 000000000000..5398ad568885
> --- /dev/null
> +++ b/tools/testing/selftests/cpufreq/amd_pstate_testmod.sh
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +# Tests the AMD P-State unit test infrastructure using amd_pstate_testmod kernel module.
> +$(dirname $0)/../kselftest/module.sh "amd_pstate_testmod" amd_pstate_testmod
> diff --git a/tools/testing/selftests/cpufreq/config b/tools/testing/selftests/cpufreq/config
> index 75e900793e8a..374a8adbb34c 100644
> --- a/tools/testing/selftests/cpufreq/config
> +++ b/tools/testing/selftests/cpufreq/config
> @@ -13,3 +13,4 @@ CONFIG_DEBUG_LOCK_ALLOC=y
>  CONFIG_PROVE_LOCKING=y
>  CONFIG_LOCKDEP=y
>  CONFIG_DEBUG_ATOMIC_SLEEP=y
> +CONFIG_AMD_PSTATE_TESTMOD=m
diff mbox series

Patch

diff --git a/tools/testing/selftests/cpufreq/Makefile b/tools/testing/selftests/cpufreq/Makefile
index c86ca8342222..c32adc59a1f4 100644
--- a/tools/testing/selftests/cpufreq/Makefile
+++ b/tools/testing/selftests/cpufreq/Makefile
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
 all:
 
-TEST_PROGS := main.sh
+TEST_PROGS := main.sh amd_pstate_testmod.sh
 TEST_FILES := cpu.sh cpufreq.sh governor.sh module.sh special-tests.sh
 
 include ../lib.mk
diff --git a/tools/testing/selftests/cpufreq/amd_pstate_testmod.sh b/tools/testing/selftests/cpufreq/amd_pstate_testmod.sh
new file mode 100755
index 000000000000..5398ad568885
--- /dev/null
+++ b/tools/testing/selftests/cpufreq/amd_pstate_testmod.sh
@@ -0,0 +1,4 @@ 
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# Tests the AMD P-State unit test infrastructure using amd_pstate_testmod kernel module.
+$(dirname $0)/../kselftest/module.sh "amd_pstate_testmod" amd_pstate_testmod
diff --git a/tools/testing/selftests/cpufreq/config b/tools/testing/selftests/cpufreq/config
index 75e900793e8a..374a8adbb34c 100644
--- a/tools/testing/selftests/cpufreq/config
+++ b/tools/testing/selftests/cpufreq/config
@@ -13,3 +13,4 @@  CONFIG_DEBUG_LOCK_ALLOC=y
 CONFIG_PROVE_LOCKING=y
 CONFIG_LOCKDEP=y
 CONFIG_DEBUG_ATOMIC_SLEEP=y
+CONFIG_AMD_PSTATE_TESTMOD=m