[X][SRU][PATCH 0/1] selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[X][SRU][PATCH 0/1] selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

Po-Hsu Lin (Sam)
BugLink: https://bugs.launchpad.net/bugs/1809699

== SRU Justification ==
This cpu-hotplug test will always return PASSED even if there are some failures there:

$ sudo make -C linux/tools/testing/selftests TARGETS=cpu-hotplug run_tests
make: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
for TARGET in cpu-hotplug; do \
 make -C $TARGET; \
done;
make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
for TARGET in cpu-hotplug; do \
 make -C $TARGET run_tests; \
done;
make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
pid 25001's current affinity mask: 3
pid 25001's new affinity mask: 1
CPU online/offline summary:
  Cpus in online state: 0-1
  Cpus in offline state: 2
Limited scope test: one hotplug cpu
  (leaves cpu in the original state):
  online to offline to online: cpu 1
  offline to online to offline: cpu 2
./cpu-on-off-test.sh: line 78: /sys/devices/system/cpu/cpu2/online: No such file or directory
online_cpu_expect_success 2: unexpected fail
./cpu-on-off-test.sh: line 83: /sys/devices/system/cpu/cpu2/online: No such file or directory
offline_cpu_expect_success 2: unexpected fail
selftests: cpu-on-off-test.sh [PASS]
make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'

== Fixes ==
8fe6e53a8ed5f0 (selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors)

For newer releases, they already have this patch.
For Trusty and older release, they will need more work to get this patch.

== Regression Potential ==
None, fix for testing tools.


Li Zhijian (1):
  selftests/cpu-hotplug: exit with failure when test occured unexpected
    behaviors

 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[X][SRU][PATCH 1/1] selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

Po-Hsu Lin (Sam)
From: Li Zhijian <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1809699

Previously, 'make run_tests -C cpu-hotplug' always PASS since cpu-on-off-test.sh
always exits 0 even though the test got some unexpected errors like below:
root@debian9:/home/lizhijian/chroot/linux/tools/testing/selftests/cpu-hotplug# make run_tests
pid 878's current affinity mask: 1
pid 878's new affinity mask: 1
CPU online/offline summary:
Cpus in online state: 0
        Cpus in offline state: 0
Limited scope test: one hotplug cpu
        (leaves cpu in the original state):
        online to offline to online: cpu 0
./cpu-on-off-test.sh: line 83: /sys/devices/system/cpu/cpu0/online: Permission denied
offline_cpu_expect_success 0: unexpected fail
./cpu-on-off-test.sh: line 78: /sys/devices/system/cpu/cpu0/online: Permission denied
online_cpu_expect_success 0: unexpected fail
selftests: cpu-on-off-test.sh [PASS]

after this patch, the test will exit with failure once it occurs some unexpected behaviors

Signed-off-by: Li Zhijian <[hidden email]>
Signed-off-by: Shuah Khan <[hidden email]>
(cherry picked from commit 8fe6e53a8ed5f043ff4e6a366ebb3a641114546b)
Signed-off-by: Po-Hsu Lin <[hidden email]>
---
 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
index 98b1d65..e5666dd 100755
--- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
+++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
@@ -89,8 +89,10 @@ online_cpu_expect_success()
 
  if ! online_cpu $cpu; then
  echo $FUNCNAME $cpu: unexpected fail >&2
+ exit 1
  elif ! cpu_is_online $cpu; then
  echo $FUNCNAME $cpu: unexpected offline >&2
+ exit 1
  fi
 }
 
@@ -100,8 +102,10 @@ online_cpu_expect_fail()
 
  if online_cpu $cpu 2> /dev/null; then
  echo $FUNCNAME $cpu: unexpected success >&2
+ exit 1
  elif ! cpu_is_offline $cpu; then
  echo $FUNCNAME $cpu: unexpected online >&2
+ exit 1
  fi
 }
 
@@ -111,8 +115,10 @@ offline_cpu_expect_success()
 
  if ! offline_cpu $cpu; then
  echo $FUNCNAME $cpu: unexpected fail >&2
+ exit 1
  elif ! cpu_is_offline $cpu; then
  echo $FUNCNAME $cpu: unexpected offline >&2
+ exit 1
  fi
 }
 
@@ -122,8 +128,10 @@ offline_cpu_expect_fail()
 
  if offline_cpu $cpu 2> /dev/null; then
  echo $FUNCNAME $cpu: unexpected success >&2
+ exit 1
  elif ! cpu_is_online $cpu; then
  echo $FUNCNAME $cpu: unexpected offline >&2
+ exit 1
  fi
 }
 
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [X][SRU][PATCH 1/1] selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

Kleber Souza
On 12/25/18 11:41 AM, Po-Hsu Lin wrote:

> From: Li Zhijian <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1809699
>
> Previously, 'make run_tests -C cpu-hotplug' always PASS since cpu-on-off-test.sh
> always exits 0 even though the test got some unexpected errors like below:
> root@debian9:/home/lizhijian/chroot/linux/tools/testing/selftests/cpu-hotplug# make run_tests
> pid 878's current affinity mask: 1
> pid 878's new affinity mask: 1
> CPU online/offline summary:
> Cpus in online state: 0
>         Cpus in offline state: 0
> Limited scope test: one hotplug cpu
>         (leaves cpu in the original state):
>         online to offline to online: cpu 0
> ./cpu-on-off-test.sh: line 83: /sys/devices/system/cpu/cpu0/online: Permission denied
> offline_cpu_expect_success 0: unexpected fail
> ./cpu-on-off-test.sh: line 78: /sys/devices/system/cpu/cpu0/online: Permission denied
> online_cpu_expect_success 0: unexpected fail
> selftests: cpu-on-off-test.sh [PASS]
>
> after this patch, the test will exit with failure once it occurs some unexpected behaviors
>
> Signed-off-by: Li Zhijian <[hidden email]>
> Signed-off-by: Shuah Khan <[hidden email]>
> (cherry picked from commit 8fe6e53a8ed5f043ff4e6a366ebb3a641114546b)
> Signed-off-by: Po-Hsu Lin <[hidden email]>

Clean cherry-pick, limited to selftests.


Acked-by: Kleber Sacilotto de Souza <[hidden email]>

> ---
>  tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
> index 98b1d65..e5666dd 100755
> --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
> +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
> @@ -89,8 +89,10 @@ online_cpu_expect_success()
>  
>   if ! online_cpu $cpu; then
>   echo $FUNCNAME $cpu: unexpected fail >&2
> + exit 1
>   elif ! cpu_is_online $cpu; then
>   echo $FUNCNAME $cpu: unexpected offline >&2
> + exit 1
>   fi
>  }
>  
> @@ -100,8 +102,10 @@ online_cpu_expect_fail()
>  
>   if online_cpu $cpu 2> /dev/null; then
>   echo $FUNCNAME $cpu: unexpected success >&2
> + exit 1
>   elif ! cpu_is_offline $cpu; then
>   echo $FUNCNAME $cpu: unexpected online >&2
> + exit 1
>   fi
>  }
>  
> @@ -111,8 +115,10 @@ offline_cpu_expect_success()
>  
>   if ! offline_cpu $cpu; then
>   echo $FUNCNAME $cpu: unexpected fail >&2
> + exit 1
>   elif ! cpu_is_offline $cpu; then
>   echo $FUNCNAME $cpu: unexpected offline >&2
> + exit 1
>   fi
>  }
>  
> @@ -122,8 +128,10 @@ offline_cpu_expect_fail()
>  
>   if offline_cpu $cpu 2> /dev/null; then
>   echo $FUNCNAME $cpu: unexpected success >&2
> + exit 1
>   elif ! cpu_is_online $cpu; then
>   echo $FUNCNAME $cpu: unexpected offline >&2
> + exit 1
>   fi
>  }
>  



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [X][SRU][PATCH 1/1] selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

Stefan Bader-2
In reply to this post by Po-Hsu Lin (Sam)
On 25.12.18 11:41, Po-Hsu Lin wrote:

> From: Li Zhijian <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1809699
>
> Previously, 'make run_tests -C cpu-hotplug' always PASS since cpu-on-off-test.sh
> always exits 0 even though the test got some unexpected errors like below:
> root@debian9:/home/lizhijian/chroot/linux/tools/testing/selftests/cpu-hotplug# make run_tests
> pid 878's current affinity mask: 1
> pid 878's new affinity mask: 1
> CPU online/offline summary:
> Cpus in online state: 0
>         Cpus in offline state: 0
> Limited scope test: one hotplug cpu
>         (leaves cpu in the original state):
>         online to offline to online: cpu 0
> ./cpu-on-off-test.sh: line 83: /sys/devices/system/cpu/cpu0/online: Permission denied
> offline_cpu_expect_success 0: unexpected fail
> ./cpu-on-off-test.sh: line 78: /sys/devices/system/cpu/cpu0/online: Permission denied
> online_cpu_expect_success 0: unexpected fail
> selftests: cpu-on-off-test.sh [PASS]
>
> after this patch, the test will exit with failure once it occurs some unexpected behaviors
>
> Signed-off-by: Li Zhijian <[hidden email]>
> Signed-off-by: Shuah Khan <[hidden email]>
> (cherry picked from commit 8fe6e53a8ed5f043ff4e6a366ebb3a641114546b)
> Signed-off-by: Po-Hsu Lin <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
> index 98b1d65..e5666dd 100755
> --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
> +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
> @@ -89,8 +89,10 @@ online_cpu_expect_success()
>  
>   if ! online_cpu $cpu; then
>   echo $FUNCNAME $cpu: unexpected fail >&2
> + exit 1
>   elif ! cpu_is_online $cpu; then
>   echo $FUNCNAME $cpu: unexpected offline >&2
> + exit 1
>   fi
>  }
>  
> @@ -100,8 +102,10 @@ online_cpu_expect_fail()
>  
>   if online_cpu $cpu 2> /dev/null; then
>   echo $FUNCNAME $cpu: unexpected success >&2
> + exit 1
>   elif ! cpu_is_offline $cpu; then
>   echo $FUNCNAME $cpu: unexpected online >&2
> + exit 1
>   fi
>  }
>  
> @@ -111,8 +115,10 @@ offline_cpu_expect_success()
>  
>   if ! offline_cpu $cpu; then
>   echo $FUNCNAME $cpu: unexpected fail >&2
> + exit 1
>   elif ! cpu_is_offline $cpu; then
>   echo $FUNCNAME $cpu: unexpected offline >&2
> + exit 1
>   fi
>  }
>  
> @@ -122,8 +128,10 @@ offline_cpu_expect_fail()
>  
>   if offline_cpu $cpu 2> /dev/null; then
>   echo $FUNCNAME $cpu: unexpected success >&2
> + exit 1
>   elif ! cpu_is_online $cpu; then
>   echo $FUNCNAME $cpu: unexpected offline >&2
> + exit 1
>   fi
>  }
>  
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [X][SRU][PATCH 0/1] selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

Khaled Elmously
In reply to this post by Po-Hsu Lin (Sam)
On 2018-12-25 18:41:47 , Po-Hsu Lin wrote:

> BugLink: https://bugs.launchpad.net/bugs/1809699
>
> == SRU Justification ==
> This cpu-hotplug test will always return PASSED even if there are some failures there:
>
> $ sudo make -C linux/tools/testing/selftests TARGETS=cpu-hotplug run_tests
> make: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
> for TARGET in cpu-hotplug; do \
>  make -C $TARGET; \
> done;
> make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
> for TARGET in cpu-hotplug; do \
>  make -C $TARGET run_tests; \
> done;
> make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
> pid 25001's current affinity mask: 3
> pid 25001's new affinity mask: 1
> CPU online/offline summary:
>   Cpus in online state: 0-1
>   Cpus in offline state: 2
> Limited scope test: one hotplug cpu
>   (leaves cpu in the original state):
>   online to offline to online: cpu 1
>   offline to online to offline: cpu 2
> ./cpu-on-off-test.sh: line 78: /sys/devices/system/cpu/cpu2/online: No such file or directory
> online_cpu_expect_success 2: unexpected fail
> ./cpu-on-off-test.sh: line 83: /sys/devices/system/cpu/cpu2/online: No such file or directory
> offline_cpu_expect_success 2: unexpected fail
> selftests: cpu-on-off-test.sh [PASS]
> make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/cpu-hotplug'
> make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
>
> == Fixes ==
> 8fe6e53a8ed5f0 (selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors)
>
> For newer releases, they already have this patch.
> For Trusty and older release, they will need more work to get this patch.
>
> == Regression Potential ==
> None, fix for testing tools.
>
>
> Li Zhijian (1):
>   selftests/cpu-hotplug: exit with failure when test occured unexpected
>     behaviors
>
>  tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team