From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97290A0524 for ; Thu, 4 Feb 2021 12:38:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87F082407A8; Thu, 4 Feb 2021 12:38:34 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 4C8BD24079E for ; Thu, 4 Feb 2021 12:38:33 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l7cy0-0005kS-Gc; Thu, 04 Feb 2021 11:38:32 +0000 From: Christian Ehrhardt To: Stephen Hemminger Cc: Harry van Haaren , dpdk stable Date: Thu, 4 Feb 2021 12:29:45 +0100 Message-Id: <20210204112954.2488123-130-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test: fix terminal settings on exit' has been queued to stable release 19.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- >From b54feaf376bf18d5ed8751f4e9c46017b41d493a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger 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 Tested-by: Harry van Haaren --- 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@dpdk.org @@ -25 +26 @@ -index ba0b0309b5..624dd48042 100644 +index d0826ca69e..4736a17ff3 100644 @@ -31 +32 @@ - #ifdef RTE_LIB_CMDLINE + #ifdef RTE_LIBRTE_CMDLINE