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 8F5CA46A19 for ; Thu, 26 Jun 2025 10:32:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 841E940430; Thu, 26 Jun 2025 10:32:51 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2C76A402CD for ; Thu, 26 Jun 2025 10:32:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750926768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g8eDx9uS33v1vJ5M02TsIFt5yZiltZW6LrOmCWNH0wA=; b=Rc2WYAH0djdfPM8HCTx9OEnr+GjrX/tZY4bIFqgYUPjUW1Z6uuK7enOn1yayyH9kL9+hOn tVP2gXxvLPDYvx/oChMmWjXFJXekK1rJnVqteWWZGNVLmWRuN9ev4fIGrOxfu9JuG2WXPt LI9kOKQ1hobSx71EzLLTvtIcbPbBpKA= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-9AuMRejnND601mCJ5Z_FFQ-1; Thu, 26 Jun 2025 04:32:46 -0400 X-MC-Unique: 9AuMRejnND601mCJ5Z_FFQ-1 X-Mimecast-MFC-AGG-ID: 9AuMRejnND601mCJ5Z_FFQ_1750926765 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-553b331c94bso334292e87.3 for ; Thu, 26 Jun 2025 01:32:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750926765; x=1751531565; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g8eDx9uS33v1vJ5M02TsIFt5yZiltZW6LrOmCWNH0wA=; b=jbRQnbd4z53izaqgs14vogdGeq7O3HhFPr0u3u0Kt0HQ2C4g1DR4Z50f8k49DtAsiU TstaE6OcSeXwPoBtRVaOZB4IhcBy5DkRY4sEzr8jKEajmN1dWbmA7M4mZ5VQXCHETs4h 41KtXmv2c2WObI7DOWaLhb1+uFPK7oFr2T5JXOcSL58MQrUC8vxzP5an4aH2L0YMpDGB pglEBDgxrx/jtJroyV6f3kfzapCzeipd9D9Cu92xApnFOdzPWpKAx53cp5Z1b0I1Smyp 8w7RBoDZvu2vMmoiGI0b3m/CQ9LFtIHHawFELDCKb0Og5agG+H3ee8LQIRVMDv6qRR10 L39g== X-Forwarded-Encrypted: i=1; AJvYcCUksJiMpafWQfN0eqDDN6YsG3LQ8G7YqSg6MKYO6o0kvTTyqLZ5fF2VGiLISPlrXurK5ZFvNFs=@dpdk.org X-Gm-Message-State: AOJu0Yxd/L+28CAQgGIpVK1/UfalXbAXUbUsp0Q+RmUcPnjdf2CtqFh4 LqvpQL2H6DN0LcEwzzuOo0/ODbb1ve21kvm5Vmd9ktDAsOklo0h21CB8xnDZH2WO8D95tii+56a sASLgXwUHZzDcV2kFSJRT5o7BjrC0xydPFlH2cDkIAHL30Sg2cP0n/FvH1WtqJeBZeNL1yfC4gP AAgejKUb677qwtvXHdnJZhKuE= X-Gm-Gg: ASbGnctAbb7SFRRXbKR2XCg83IZNRXo+9P1MajHYmoaIrFSrMZ5lrkndvpRw4ju7p6m dIe4SCeG3k8Od/9rvpaaozaTa/bgoogkDfoC4GvQ4XKJCBF/t0qRda2KYAhWVFOoA0HHE307TX6 2iDmEMIg== X-Received: by 2002:a05:6512:3b89:b0:553:3770:c912 with SMTP id 2adb3069b0e04-554fdfb1bb9mr2116348e87.47.1750926765227; Thu, 26 Jun 2025 01:32:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQ6A0fc+qZDlvYRLnUzZJhxctWHj8KMxYhevKe0aj99G4sthGEQGqsUz51+t+LyhzdsUal4NW50AqNR6fl2No= X-Received: by 2002:a05:6512:3b89:b0:553:3770:c912 with SMTP id 2adb3069b0e04-554fdfb1bb9mr2116340e87.47.1750926764771; Thu, 26 Jun 2025 01:32:44 -0700 (PDT) MIME-Version: 1.0 References: <20250619071037.37325-1-david.marchand@redhat.com> <20250623135242.461965-1-david.marchand@redhat.com> <20250623135242.461965-3-david.marchand@redhat.com> <08ce2412f18d477199d3e02fdcf9bcd4@huawei.com> In-Reply-To: <08ce2412f18d477199d3e02fdcf9bcd4@huawei.com> From: David Marchand Date: Thu, 26 Jun 2025 10:32:33 +0200 X-Gm-Features: Ac12FXyH7nQba201kn0CjUkjg1vmUro_aRwYoim9HG3AwrFt2BuPVodA9wtu2dE Message-ID: Subject: Re: [PATCH v2 02/10] test/telemetry: fix test calling all commands To: Marat Khalili Cc: "dev@dpdk.org" , "stable@dpdk.org" , Bruce Richardson X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4A5Ex5XbBaSz_EJfptbuW6e0T9i7QI39MbradNwVoXM_1750926765 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Jun 24, 2025 at 6:00=E2=80=AFPM Marat Khalili wrote: > > Reviewed-by: Marat Khalili > > Just an idea, in case you have another iteration: could we maybe add a sm= all check that $telemetry_script actually exists and executable to avoid si= milar situations in the future? Can be as simple as: > > test -f "$telemetry_script" > test -x "$telemetry_script" > > Due to -e in the first line it should fail the script of any of these tes= ts fail. The problem lies in the use of subshell and pipes and that a failure is not propagated. Adding a test only the the telemetry script would not catch other errors (like for example, if the jq command starts to spew errors). The most elegant would be to use errtrace and pipefail options, but the errtrace is a bashism (iow not POSIX), and pipefail is POSIX only since 2022 and many shell (like dash in Ubuntu 22.04/24.04) don't implement it. We could try something like: diff --git a/app/test/suites/test_telemetry.sh b/app/test/suites/test_telemetry.sh index ca6abe266e..a81b4add90 100755 --- a/app/test/suites/test_telemetry.sh +++ b/app/test/suites/test_telemetry.sh @@ -15,7 +15,7 @@ call_all_telemetry() { telemetry_script=3D$rootdir/usertools/dpdk-telemetry.py echo >$tmpoutput echo "Telemetry commands log:" >>$tmpoutput - for cmd in $(echo / | $telemetry_script | jq -r '.["/"][]') + echo / | $telemetry_script | jq -r '.["/"][]' | while read cmd do for input in $cmd $cmd,0 $cmd,z do @@ -25,4 +25,5 @@ call_all_telemetry() { done } -(sleep 1 && call_all_telemetry && echo quit) | $@ +! set -o | grep -q pipefail || set -o pipefail +(set -e; ! set -o | grep -q pipefail || set -o pipefail; sleep 1 && call_all_telemetry && echo quit) | $@ --=20 David Marchand