diff mbox series

[V3] selftests/vm: Add protection_keys tests to run_vmtests

Message ID 20220617111019.476-1-kalpana.shetty@amd.com (mailing list archive)
State New
Headers show
Series [V3] selftests/vm: Add protection_keys tests to run_vmtests | expand

Commit Message

Shetty, Kalpana June 17, 2022, 11:10 a.m. UTC
Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests
from a single shell script.

Signed-off-by: Kalpana Shetty <kalpana.shetty@amd.com>
---
Changes in V3:
 Shuah Khan's review comments incorporated, added protection_keys binary check.

 tools/testing/selftests/vm/run_vmtests.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Shuah Khan June 17, 2022, 7:31 p.m. UTC | #1
On 6/17/22 5:10 AM, Kalpana Shetty wrote:
> Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests
> from a single shell script.
> 
> Signed-off-by: Kalpana Shetty <kalpana.shetty@amd.com>
> ---
> Changes in V3:
>   Shuah Khan's review comments incorporated, added protection_keys binary check.
> 
>   tools/testing/selftests/vm/run_vmtests.sh | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh
> index 41fce8bea929..b19c6b1b84c4 100755
> --- a/tools/testing/selftests/vm/run_vmtests.sh
> +++ b/tools/testing/selftests/vm/run_vmtests.sh
> @@ -179,4 +179,15 @@ run_test ./ksm_tests -N -m 1
>   # KSM test with 2 NUMA nodes and merge_across_nodes = 0
>   run_test ./ksm_tests -N -m 0
>   
> +# protection_keys tests
> +if ./protection_keys_32 &> /dev/null
> +then
> +	run_test ./protection_keys_32
> +fi
> +
> +if ./protection_keys_64 &> /dev/null
> +then
> +	run_test ./protection_keys_64
> +fi
> +
>   exit $exitcode
> 

Why not use file test operators. -x works for this case.
There is no need to run attempt to run the test.

thanks,
-- Shuah
Shetty, Kalpana June 17, 2022, 8:31 p.m. UTC | #2
On 6/18/2022 1:01 AM, Shuah Khan wrote:
> On 6/17/22 5:10 AM, Kalpana Shetty wrote:
>> Adding "protected_keys" tests to "run_vmtests.sh" would help out to 
>> run all VM related tests
>> from a single shell script.
>>
>> Signed-off-by: Kalpana Shetty <kalpana.shetty@amd.com>
>> ---
>> Changes in V3:
>>   Shuah Khan's review comments incorporated, added protection_keys 
>> binary check.
>>
>>   tools/testing/selftests/vm/run_vmtests.sh | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/tools/testing/selftests/vm/run_vmtests.sh 
>> b/tools/testing/selftests/vm/run_vmtests.sh
>> index 41fce8bea929..b19c6b1b84c4 100755
>> --- a/tools/testing/selftests/vm/run_vmtests.sh
>> +++ b/tools/testing/selftests/vm/run_vmtests.sh
>> @@ -179,4 +179,15 @@ run_test ./ksm_tests -N -m 1
>>   # KSM test with 2 NUMA nodes and merge_across_nodes = 0
>>   run_test ./ksm_tests -N -m 0
>>   +# protection_keys tests
>> +if ./protection_keys_32 &> /dev/null
>> +then
>> +    run_test ./protection_keys_32
>> +fi
>> +
>> +if ./protection_keys_64 &> /dev/null
>> +then
>> +    run_test ./protection_keys_64
>> +fi
>> +
>>   exit $exitcode
>>
>
> Why not use file test operators. -x works for this case.
> There is no need to run attempt to run the test.
Sure; thanks for the suggestion. Sent V4 patch.
>
> thanks,
> -- Shuah

Thanks,

Kalpana
diff mbox series

Patch

diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh
index 41fce8bea929..b19c6b1b84c4 100755
--- a/tools/testing/selftests/vm/run_vmtests.sh
+++ b/tools/testing/selftests/vm/run_vmtests.sh
@@ -179,4 +179,15 @@  run_test ./ksm_tests -N -m 1
 # KSM test with 2 NUMA nodes and merge_across_nodes = 0
 run_test ./ksm_tests -N -m 0
 
+# protection_keys tests
+if ./protection_keys_32 &> /dev/null
+then
+	run_test ./protection_keys_32
+fi
+
+if ./protection_keys_64 &> /dev/null
+then
+	run_test ./protection_keys_64
+fi
+
 exit $exitcode