Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2019-11-06 17:49:33 +0800
committerGary Lin <glin@suse.com>2019-11-06 17:49:39 +0800
commit7138ef7df4f9f003c2f6e7de1e6eab686c934ae6 (patch)
tree493e9d5ccc66030be2d86c6399a7729c23049da5
parent86c4b30f999a99bbe906b11a78f439d10a33ef6c (diff)
selftests/bpf: improve unexpected success reporting in
test_syctl (bsc#1155518).
-rw-r--r--patches.suse/selftests-bpf-improve-unexpected-success-reporting-i.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.suse/selftests-bpf-improve-unexpected-success-reporting-i.patch b/patches.suse/selftests-bpf-improve-unexpected-success-reporting-i.patch
new file mode 100644
index 0000000000..5d38c06010
--- /dev/null
+++ b/patches.suse/selftests-bpf-improve-unexpected-success-reporting-i.patch
@@ -0,0 +1,39 @@
+From: Ilya Leoshkevich <iii@linux.ibm.com>
+Date: Fri, 30 Aug 2019 13:07:31 +0200
+Subject: selftests/bpf: improve unexpected success reporting in test_syctl
+Patch-mainline: v5.4-rc1
+Git-commit: 416c572821841bef2cbb6346fb559901efff4ff3
+References: bsc#1155518
+
+When tests fail because sysctl() unexpectedly succeeds, they print an
+inappropriate "Unexpected failure" message and a random errno. Zero
+out errno before calling sysctl() and replace the message with
+"Unexpected success".
+
+Fixes: 1f5fa9ab6e2e ("selftests/bpf: Test BPF_CGROUP_SYSCTL")
+Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Acked-by: Gary Lin <glin@suse.com>
+---
+ tools/testing/selftests/bpf/test_sysctl.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/tools/testing/selftests/bpf/test_sysctl.c
++++ b/tools/testing/selftests/bpf/test_sysctl.c
+@@ -1499,6 +1499,7 @@ static int run_test_case(int cgfd, struc
+ goto err;
+ }
+
++ errno = 0;
+ if (access_sysctl(sysctl_path, test) == -1) {
+ if (test->result == OP_EPERM && errno == EPERM)
+ goto out;
+@@ -1507,7 +1508,7 @@ static int run_test_case(int cgfd, struc
+ }
+
+ if (test->result != SUCCESS) {
+- log_err("Unexpected failure");
++ log_err("Unexpected success");
+ goto err;
+ }
+
diff --git a/series.conf b/series.conf
index 58a22cfdfa..a5fb3bd35c 100644
--- a/series.conf
+++ b/series.conf
@@ -1137,6 +1137,7 @@
patches.suse/libbpf-add-flags-to-umem-config.patch
patches.suse/selftests-bpf-introduce-bpf_cpu_to_be64-and-bpf_be64.patch
patches.suse/selftests-bpf-fix-ctx-write-sysctl-write-read-ok-on-.patch
+ patches.suse/selftests-bpf-improve-unexpected-success-reporting-i.patch
patches.suse/i40e-fix-xdp-handle-calculations.patch
patches.suse/ixgbe-fix-xdp-handle-calculations.patch
patches.suse/xsk-avoid-store-tearing-when-assigning-queues.patch