[dpdk-stable] patch 'test: fix terminal settings on exit' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Feb 4 12:29:45 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/06/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/b54feaf376bf18d5ed8751f4e9c46017b41d493a

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From b54feaf376bf18d5ed8751f4e9c46017b41d493a Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 14 Jan 2021 08:45:37 -0800
Subject: [PATCH] test: fix terminal settings on exit

[ upstream commit acdabc450ea087815f8d93cf139ac265c638f99f ]

When running one test (via DPDK_TEST) the test program
would leave the terminal in raw mode.  This was because
it was setting up cmdline to do interactive input.

The fix is to use cmdline_new() for the interactive case.

This also fixes a memory leak because the test
runner was never calling cmdline_free().

Fixes: 9b848774a5dc ("test: use env variable to run tests")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Tested-by: Harry van Haaren <harry.van.haaren at intel.com>
---
 app/test/test.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/app/test/test.c b/app/test/test.c
index d0826ca69e..4736a17ff3 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -164,29 +164,38 @@ main(int argc, char **argv)
 
 
 #ifdef RTE_LIBRTE_CMDLINE
-	cl = cmdline_stdin_new(main_ctx, "RTE>>");
-	if (cl == NULL) {
-		ret = -1;
-		goto out;
-	}
-
 	char *dpdk_test = getenv("DPDK_TEST");
 	if (dpdk_test && strlen(dpdk_test)) {
 		char buf[1024];
+
+		cl = cmdline_new(main_ctx, "RTE>>", 0, 1);
+		if (cl == NULL) {
+			ret = -1;
+			goto out;
+		}
+
 		snprintf(buf, sizeof(buf), "%s\n", dpdk_test);
 		if (cmdline_in(cl, buf, strlen(buf)) < 0) {
 			printf("error on cmdline input\n");
+
+			ret = -1;
+		} else {
+			ret = last_test_result;
+		}
+		cmdline_free(cl);
+		goto out;
+	} else {
+		/* if no DPDK_TEST env variable, go interactive */
+		cl = cmdline_stdin_new(main_ctx, "RTE>>");
+		if (cl == NULL) {
 			ret = -1;
 			goto out;
 		}
 
+		cmdline_interact(cl);
 		cmdline_stdin_exit(cl);
-		ret = last_test_result;
-		goto out;
+		cmdline_free(cl);
 	}
-	/* if no DPDK_TEST env variable, go interactive */
-	cmdline_interact(cl);
-	cmdline_stdin_exit(cl);
 #endif
 	ret = 0;
 
-- 
2.30.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-04 12:04:33.307974699 +0100
+++ 0130-test-fix-terminal-settings-on-exit.patch	2021-02-04 12:04:28.194789887 +0100
@@ -1 +1 @@
-From acdabc450ea087815f8d93cf139ac265c638f99f Mon Sep 17 00:00:00 2001
+From b54feaf376bf18d5ed8751f4e9c46017b41d493a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit acdabc450ea087815f8d93cf139ac265c638f99f ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index ba0b0309b5..624dd48042 100644
+index d0826ca69e..4736a17ff3 100644
@@ -31 +32 @@
- #ifdef RTE_LIB_CMDLINE
+ #ifdef RTE_LIBRTE_CMDLINE


More information about the stable mailing list