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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 15 12:45:01 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/17/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f1b0814307fa96bc085528ab22e5590fee445ca1

Thanks.

Luca Boccassi

---
>From f1b0814307fa96bc085528ab22e5590fee445ca1 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

[ 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.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-15 11:44:13.692152203 +0000
+++ 0002-test-bbdev-fix-Python-script-subprocess.patch	2023-11-15 11:44:13.522386553 +0000
@@ -1 +1 @@
-From 262c9d13f7c998fdca526b28871f37b47fbbb464 Mon Sep 17 00:00:00 2001
+From f1b0814307fa96bc085528ab22e5590fee445ca1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 262c9d13f7c998fdca526b28871f37b47fbbb464 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list