Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1620013lqp; Mon, 15 Apr 2024 11:38:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWlq3H486/8774hoAVvbJTyyLZkDGPdjHyIuapod8BwTBOhQjygbySw2dYqJir08ezGz3ZwALfEWSQFrkuKw7B/Wgtvr9f3vHBimnF4Aw== X-Google-Smtp-Source: AGHT+IF1WL7VAVfvP+KELmZ+CcKvj1jj1juZeA2xhRsKgVu3U8xaLMKhOqDceRwKII4dO14lOGvX X-Received: by 2002:a05:6a21:3d84:b0:1a7:1df5:1699 with SMTP id bj4-20020a056a213d8400b001a71df51699mr9115858pzc.27.1713206281921; Mon, 15 Apr 2024 11:38:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713206281; cv=pass; d=google.com; s=arc-20160816; b=pKkGOSigeflf19vZP7PmY1QlbzL3V24mPHvSerWF2yxuMpixG85XWmDRWCekA3CUTF rIC1QeGIyDxJwWzzhjehQuwW6KYmwRZvv6LptoeN48lG30J/qiIyUM8mR9+jMpyVq1wB FJcNU8Af+QEpHcPf0q6w2mKw2c+WOYpb1IyMq2EXAugB9gF5+43Adb3kkLvnkasX1CjI yulXTzf2DYLfLN4U1dtCWKSgO3spRJ8JIauhRUe4Jo2AUIGbFVAc1WHpk3frg4K3urMX 6FJwdy2ESNkIX9pNRb+pOXNOp8eqpK3u6MHygAixhFhqNIhWls1MjG/5pPFVtlsszPnp dCPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=h/4HrrspOH6XCcBE6RNYkgnq/r+NqD6rMD6pDM5KzZA=; fh=3YBUlsc5ACOC6g9wnWN9evtgkE+psAfiMy4GsvQTPrc=; b=rvRWkeMKkGwxzlci3pXaqlssMUifur2ZxeU+aT4HyoksgUWQDjk2Ypk3Gl62DhZ6/A MekKlgr9n+rhYcuJoygFUNqEZC2CWrY3kfokVFPCCFrDXsXWQ3vXs7yFZDzHuygRv3hM CvYPgAk/kYfPNy6yOc2WGwY9IwD9jGirWAi95lm6jVeSKeDBxXdy0Uezvap0e5bB71+g RstyZ8UVXwSn5+o7xqftZKTy1oFKp3V2pJoVF4IsAjxE0y5iv8tM+EOsMXOZkJEJWm0d 3AoyVe64SI1UrTCQAWYr5FOFBMprYiCVUpQ2+SghM+faQLTn/3SJc4kZyEETnCtocOkc fBKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=twzbk0p5; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-145720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fv14-20020a056a00618e00b006e795688a84si6698142pfb.261.2024.04.15.11.38.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:38:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=twzbk0p5; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-145720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 76C47281825 for ; Mon, 15 Apr 2024 18:38:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3DF31552E2; Mon, 15 Apr 2024 18:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="twzbk0p5" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96F8C41C66; Mon, 15 Apr 2024 18:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713206273; cv=none; b=Mu/tA0r52RI2LlLFNFoBfEn0eXCV4ht7O+EBRo+Jl9BAee3aZgXlhbO45UWDHOqNzzmmCEhnWBEgXkC3Nf4g9w6zYcUwYFR2WO3A7pu97SYtoSYSUsZqTG7aMjqqxYHJTpXJ3fGOMg3H9fZtFTT7B/HWb7d0g+Tl8AGa9eZXgHY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713206273; c=relaxed/simple; bh=yZUuC3xzyPoLW4oe9jvfM0QlOUieP/gu7KYwV8GgId0=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=eeHvEeWkXHZVxLrNlNpsV7V6t5PFDy2XiAiErRUCaRkhzCCWOQaYt/Tp4zO0tTeTQKCGZZ9/K01Aa0uMbtaL7vw61lpEJunT8yavhd0uBv1DtVSpfy1ZbjQWkud7600QMSsBcz8UQLSZ1VFD2DulQl004cd+limmzmtbvXiPjJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=twzbk0p5; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713206269; bh=yZUuC3xzyPoLW4oe9jvfM0QlOUieP/gu7KYwV8GgId0=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=twzbk0p5jq+YnJyXlk19OjdxVwEag+GgnPZKIvHLenZ5wHmP+th9jYP/7YSLydF59 0xILVs+Ycz3S74s00LROxxV3Hw0QdAEv1O0JBuVMJUpIS7HrCmfsLXtQUHkMOuS7GL i5Pfqa9/+k16VXLFlb72Lj+wjjMm2zr/4CkV5wSOdT34UNAZbUSGfZpJSPK+EnDec3 xmsZCm2GcqK2rwy0z/sbDEROREtfpl1wkI0jGuOCzf41/01yZ7cU2c93vKV7AHLw59 3tO986dFhNct6uYt05P6zlwgCYhhSx/vxRQd1oijt0nh0XArvhNz0qgk7y1Pk0NLz0 Ye9mPllP+LCFw== Received: from [10.193.1.1] (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 9143537810F1; Mon, 15 Apr 2024 18:37:47 +0000 (UTC) Message-ID: <732fb6c2-230d-4d48-8ecc-dba6c1688142@collabora.com> Date: Mon, 15 Apr 2024 23:38:20 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , Sebastian Reichel , Mike Looijmans , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 1/2] selftests: ktap_helpers: Make it POSIX-compliant To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Shuah Khan References: <20240415-supply-selftest-posix-sh-v1-0-328f008d698d@collabora.com> <20240415-supply-selftest-posix-sh-v1-1-328f008d698d@collabora.com> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: <20240415-supply-selftest-posix-sh-v1-1-328f008d698d@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 4/15/24 8:32 PM, NĂ­colas F. R. A. Prado wrote: > There are a couple uses of bash specific syntax in the script. Change > them to the equivalent POSIX syntax. This doesn't change functionality > and allows non-bash test scripts to make use of these helpers. > > Reported-by: Mike Looijmans > Closes: https://lore.kernel.org/all/efae4037-c22a-40be-8ba9-7c1c12ece042@topic.nl/ > Fixes: 2dd0b5a8fcc4 ("selftests: ktap_helpers: Add a helper to finish the test") > Fixes: 14571ab1ad21 ("kselftest: Add new test for detecting unprobed Devicetree devices") > Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/kselftest/ktap_helpers.sh | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/kselftest/ktap_helpers.sh b/tools/testing/selftests/kselftest/ktap_helpers.sh > index f2fbb914e058..79a125eb24c2 100644 > --- a/tools/testing/selftests/kselftest/ktap_helpers.sh > +++ b/tools/testing/selftests/kselftest/ktap_helpers.sh > @@ -43,7 +43,7 @@ __ktap_test() { > directive="$3" # optional > > local directive_str= > - [[ ! -z "$directive" ]] && directive_str="# $directive" > + [ ! -z "$directive" ] && directive_str="# $directive" > > echo $result $KTAP_TESTNO $description $directive_str > > @@ -99,7 +99,7 @@ ktap_exit_fail_msg() { > ktap_finished() { > ktap_print_totals > > - if [ $(("$KTAP_CNT_PASS" + "$KTAP_CNT_SKIP")) -eq "$KSFT_NUM_TESTS" ]; then > + if [ $((KTAP_CNT_PASS + KTAP_CNT_SKIP)) -eq "$KSFT_NUM_TESTS" ]; then > exit "$KSFT_PASS" > else > exit "$KSFT_FAIL" > -- BR, Muhammad Usama Anjum