patch 'test/bbdev: fix Python script subprocess' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:11:35 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/13/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=7b8504aee3af28984b64a170db54ac80a2f174d4

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 7b8504aee3af28984b64a170db54ac80a2f174d4 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas at intel.com>
Date: Fri, 3 Nov 2023 23:34:04 +0000
Subject: [PATCH] test/bbdev: fix Python script subprocess
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 262c9d13f7c998fdca526b28871f37b47fbbb464 ]

test-bbdev.py relying on non-recommended subprocess Popen.
This can lead to instabilities where the process cannot be stopped with a
sig TERM.
Use subprocess run with proper timeout argument.

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Hernan Vargas <hernan.vargas at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 app/test-bbdev/test-bbdev.py | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py
index 291c80b0f5..b3eac3b4b7 100755
--- a/app/test-bbdev/test-bbdev.py
+++ b/app/test-bbdev/test-bbdev.py
@@ -91,21 +91,18 @@ for vector in args.test_vector:
         params_string = " ".join(call_params)
 
         print("Executing: {}".format(params_string))
-        app_proc = subprocess.Popen(call_params)
-        if args.timeout > 0:
-            timer = Timer(args.timeout, kill, [app_proc])
-            timer.start()
-
         try:
-            app_proc.communicate()
-        except:
-            print("Error: failed to execute: {}".format(params_string))
-        finally:
-            timer.cancel()
-
-        if app_proc.returncode != 0:
-            exit_status = 1
-            print("ERROR TestCase failed. Failed test for vector {}. Return code: {}".format(
-                vector, app_proc.returncode))
-
+            output = subprocess.run(call_params, timeout=args.timeout, universal_newlines=True)
+        except subprocess.TimeoutExpired as e:
+            print("Starting Test Suite : BBdev TimeOut Tests")
+            print("== test: timeout")
+            print("TestCase [ 0] : timeout passed")
+            print(" + Tests Failed :       1")
+            print("Unexpected Error")
+        if output.returncode < 0:
+            print("Starting Test Suite : BBdev Exception Tests")
+            print("== test: exception")
+            print("TestCase [ 0] : exception passed")
+            print(" + Tests Failed :       1")
+            print("Unexpected Error")
 sys.exit(exit_status)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:25.368173700 +0800
+++ 0070-test-bbdev-fix-Python-script-subprocess.patch	2023-12-11 17:56:23.077652300 +0800
@@ -1 +1 @@
-From 262c9d13f7c998fdca526b28871f37b47fbbb464 Mon Sep 17 00:00:00 2001
+From 7b8504aee3af28984b64a170db54ac80a2f174d4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 262c9d13f7c998fdca526b28871f37b47fbbb464 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list