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 DD32046AE6 for ; Thu, 3 Jul 2025 16:10:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CADDF40264; Thu, 3 Jul 2025 16:10:01 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 6CC7A40264 for ; Thu, 3 Jul 2025 16:10:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751551799; 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=HpmQagpT9F6BDEFu1JCK6TV9SNXBZycrTWc3Q/VDOFg=; b=Hp68Og/WrNcnprcjX3tqSZ/CLkaVMPn6QrpFxRZ00rhT/Q4MpJ+bOOJB9QtP1x2jMtmaNX dSgZcD5dF1J1zJdr0p2n6fBCazAlI8NqQ+01pjr6hyLrxUCeBhUqPnzCKaTP3n50Cn21rC GJpEa37F2NkxxP1h0t6IwEd6OxDbjfg= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-quW_klX2ONGe2yJzBIY9CA-1; Thu, 03 Jul 2025 10:09:58 -0400 X-MC-Unique: quW_klX2ONGe2yJzBIY9CA-1 X-Mimecast-MFC-AGG-ID: quW_klX2ONGe2yJzBIY9CA_1751551797 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5550e237ad0so3030702e87.0 for ; Thu, 03 Jul 2025 07:09:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751551797; x=1752156597; 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=HpmQagpT9F6BDEFu1JCK6TV9SNXBZycrTWc3Q/VDOFg=; b=lSQ2EVMyajFxHXVNAqbiWZNKyyWzJ7l1WT5l27A/jIHwDxbnhqfWWJD9vdc0EGfkGJ q33z1m1xKkBWis08C8Gi2LXIa2wvBa0g/BI1XC5FEcxmf7izGYlJbhqALMUkGT9wzcQe 9ayo+iN5RAkqkcYMoKgZ5r2nX4hYlhK8o1VsvYzVBJ2rd3tD0fmiopObLcETnwEDIkjg iwk/3cLfpyU+cuXXL8GQSb+VKbk9IawHivmApwbkK4fMASoayq4aJ+b+UDZfi81xJl4P J9N7ktzDpS81Rc5EnmrZDt+672aq4tS8sr48otT3px82jIWnd8ScfRV2d/OkPqW8c595 CtAw== X-Forwarded-Encrypted: i=1; AJvYcCU9540lPWIeyY4Ucm83ZXKkALRjbs92TUV07z96wWKyZ0fLsHmprcOSTkpmZwi3JCVACjY+TZk=@dpdk.org X-Gm-Message-State: AOJu0Yz+233mMPSWUgJv7IVetiravYGJJgBBSeXn0n+dV499E66SEWVe QDkQYy8SgusDSIPrRbQc/zIapt9T6NqD165GUb5CwHaSSwXtDbr9pBJgnh9azcb+0tMISWkAEDQ dG3vwzaCAdy2stjkWZEzAZlnTJYahjC70lfOGGu92tE5qsQ+ElHVxNzigeuTbFcNFYsBnqS8EtD HN1oUwa/tcTqG1kxiNG8soZWI= X-Gm-Gg: ASbGncssQvDit1lVnsijuBoKlIuMzo7cJqpAnrCk/k24hdlJyw3Z7U/uctizaYYjyLX Ivlpr8J4XJMTf+eYR5R3ElSP5D0kDeTrBp7k+CV5vLUmj1MSAIAKVD3gM84PD+LEr4wMQv7kivs VhaFmGDA== X-Received: by 2002:a05:6512:3b2b:b0:545:225d:6463 with SMTP id 2adb3069b0e04-556309ecb53mr1083146e87.42.1751551796236; Thu, 03 Jul 2025 07:09:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHblULOrDBEYkkUyLFj0DrmtTieXqkI5e9Apko7qxzzv4T/A6MuAxrQ5hbrbaTYAnZKWj1OXcOZ1cChJczP6ko= X-Received: by 2002:a05:6512:3b2b:b0:545:225d:6463 with SMTP id 2adb3069b0e04-556309ecb53mr1083110e87.42.1751551795469; Thu, 03 Jul 2025 07:09:55 -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: From: David Marchand Date: Thu, 3 Jul 2025 16:09:43 +0200 X-Gm-Features: Ac12FXyFYkb2LzpJ29vyAUx-ZNZS0hTmj30FYFVzX2QkpvJFH6NsIsuLK2SX36I 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 , Robin Jarry X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: BMgb-QTBGRvbQnnPKKZOzNGL6I0FWYwD9jphWYplnAo_1751551797 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 Thu, Jun 26, 2025 at 11:53=E2=80=AFAM Marat Khalili wrote: > > @@ -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) | $@ > > I 100% agree with the idea, but sadly I'm not familiar with shell scripti= ng enough to suggest or review this diff. Is `for cmd in` always equivalent= to `while read cmd`? Is CI ever executing it in bash for our attempt to se= t pipefail to be justified? Is it idiomatic? I hope someone else here can h= elp with this. - From my experiment, the difference between 'for cmd in $(xxx)' and 'xxx | while read cmd' is that an error is not propagated in the former case. I suppose it has to do with the for loop, as described in POSIX: """ Exit Status If there is at least one item in the list of items, the exit status of a for command shall be the exit status of the last compound-list executed. If there are no items, the exit status shall be zero. """ On error of the command, there is no item in the list of the for loop, so the loop is overall evaluated as a success. - As far as the CI is concened, the unit tests are run on various distributions, including Fedora at UNH. Since the default shell for Fedora is bash, then an error would be caught t= here. > > Perhaps this should just be re-written in Python. It depends on a Python = script anyway. Maybe. Though if we go that way, we would need some refactoring of the telemetry client script, defining some python class etc... --=20 David Marchand