diff mbox series

[4/4] selftest/vm: add skip support to mremap_test

Message ID 20220414171529.62058-5-sidhartha.kumar@oracle.com (mailing list archive)
State New
Headers show
Series selftest/vm fix segfault in mremap_test | expand

Commit Message

Sidhartha Kumar April 14, 2022, 5:15 p.m. UTC
Allow the mremap test to be skipped due to errors
such as failing to find a valid remap region and
failure to parse the mmap_min_addr sysctl.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 tools/testing/selftests/vm/run_vmtests.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Shuah Khan April 14, 2022, 9:49 p.m. UTC | #1
On 4/14/22 11:15 AM, Sidhartha Kumar wrote:
> Allow the mremap test to be skipped due to errors
> such as failing to find a valid remap region and
> failure to parse the mmap_min_addr sysctl.
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---
>   tools/testing/selftests/vm/run_vmtests.sh | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh
> index 88e15fbb5027..eae98f5de2cc 100755
> --- a/tools/testing/selftests/vm/run_vmtests.sh
> +++ b/tools/testing/selftests/vm/run_vmtests.sh
> @@ -272,11 +272,16 @@ echo "-------------------"
>   echo "running mremap_test"
>   echo "-------------------"
>   ./mremap_test
> -if [ $? -ne 0 ]; then
> +ret_val=$?
> +
> +if [ $ret_val -eq 0 ]; then
> +	echo "[PASS]"
> +elif [ $ret_val -eq $ksft_skip ]; then
> +	 echo "[SKIP]"
> +	 exitcode=$ksft_skip
> +else
>   	echo "[FAIL]"
>   	exitcode=1
> -else
> -	echo "[PASS]"
>   fi
>   
>   echo "-----------------"
> 

Thank you. Looks good to me.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh
index 88e15fbb5027..eae98f5de2cc 100755
--- a/tools/testing/selftests/vm/run_vmtests.sh
+++ b/tools/testing/selftests/vm/run_vmtests.sh
@@ -272,11 +272,16 @@  echo "-------------------"
 echo "running mremap_test"
 echo "-------------------"
 ./mremap_test
-if [ $? -ne 0 ]; then
+ret_val=$?
+
+if [ $ret_val -eq 0 ]; then
+	echo "[PASS]"
+elif [ $ret_val -eq $ksft_skip ]; then
+	 echo "[SKIP]"
+	 exitcode=$ksft_skip
+else
 	echo "[FAIL]"
 	exitcode=1
-else
-	echo "[PASS]"
 fi
 
 echo "-----------------"