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 DDCFCA0524 for ; Fri, 5 Feb 2021 12:31:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D868B40682; Fri, 5 Feb 2021 12:31:38 +0100 (CET) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mails.dpdk.org (Postfix) with ESMTP id 05AD51889A0 for ; Fri, 5 Feb 2021 12:31:37 +0100 (CET) Received: by mail-wm1-f52.google.com with SMTP id w4so5736067wmi.4 for ; Fri, 05 Feb 2021 03:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u7TWb+p0rTb6tienmky9c8BGTH0CdhGgiViOg+MPy8U=; b=eIrNacJyBC/fsCLxnoZu6MIJ5lt4e8O0hFErlHs11ZutV9QaPdl8OChY7bnMtOjg+W 7NhnKoV7lByfBmCPip8EcyXJZrrwuDDJ5ZcgR3vP9UiU7h7F7r4L70TkykHa9/LY3l/7 JKcjISfZFvk60yPA8yzVFPLVzE0MAg32cXFf9XPpdPwkSSijmkQNzT1XVkJJZKlQBpB8 1g9VOc8TMQLZOqOewVGbuP7RzwE/CWTz6DxnnmfRZg3pbFxv8WbxfQllnpBi3o2rdnY/ UUYdRtQcVXGCc9hGs+WehPKi2ay3WPPvdNbCoPfik1a3dX8sQoz8M057qTsPWAlwEvqo 9MSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u7TWb+p0rTb6tienmky9c8BGTH0CdhGgiViOg+MPy8U=; b=GakBprpiuqH0EZ8yFOEf1DoVxoeZas6+BitPOu3zohsQR1Hn9ohWwfp6kg8YilKWC+ buwW7n6HtvRqN1WSht5ren7eoCoFvn9FeIJ8OXWyPR5ReTiAfUAqGZJbIto1pypCfeCk IJeXDh7nAa9mX1Bui84EkENW7HsFv7I/yfYu0b64znTv8J8R5MFWuckE65+2jVw9p+jm QfiV7k1etZdpGI0iWq42/T+Kdp24swjyAwHJXRbGkw87WQJq+qqg/STwCYqpv4mBcpwd GKabPB8s+tvL86Z+pgxFGWZ8qdoKQwMbNjB/B/3W3buBrlVHa6oIViHjFuRQbEnmm8Qk YaHQ== X-Gm-Message-State: AOAM530CXnZwphKIDg1RL1T4jCpF9dHUkuWm07YIseq6tjoqkh88ZC6M T+WrtFMePcfzcdEnkv+3iw8= X-Google-Smtp-Source: ABdhPJwG03q4AVpvoUW19I/3QA/4JUojO5JcdHLqGyYsdjR1AlwZPdcmkIQDi9/HU4QnkyFBa+eMLw== X-Received: by 2002:a7b:c21a:: with SMTP id x26mr3254918wmi.50.1612524696811; Fri, 05 Feb 2021 03:31:36 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t17sm8597953wmi.46.2021.02.05.03.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:31:36 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Harry van Haaren , dpdk stable Date: Fri, 5 Feb 2021 11:16:48 +0000 Message-Id: <20210205111920.1272063-122-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.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 20.11.1 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 20.11.1 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/07/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/77ce48ce03e93b6ad72091a0399be7ee22387e67 Thanks. Luca Boccassi --- >From 77ce48ce03e93b6ad72091a0399be7ee22387e67 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 ba0b0309b5..624dd48042 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -164,29 +164,38 @@ main(int argc, char **argv) #ifdef RTE_LIB_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.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:34.667808271 +0000 +++ 0122-test-fix-terminal-settings-on-exit.patch 2021-02-05 11:18:28.994694692 +0000 @@ -1 +1 @@ -From acdabc450ea087815f8d93cf139ac265c638f99f Mon Sep 17 00:00:00 2001 +From 77ce48ce03e93b6ad72091a0399be7ee22387e67 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit acdabc450ea087815f8d93cf139ac265c638f99f ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org