From patchwork Mon Apr 15 15:32:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13630224 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 0801676046; Mon, 15 Apr 2024 15:32:40 +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=1713195162; cv=none; b=Q8ADlvQnv4sbEZho9TX1fFxajld0E+K8aLhalu6bF8RkYVKY+BHu2aob1Wq7vzGCoR68gcK4FKLjD8vFdwzU3aAHd3G3kTLhV7aNjj6w+qMgyTte5j6x1vK0f5ysqOW4f/h1Zro7PcHRrjsi6PN4cCG7dVLu+qIeZCBOrTqqZws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713195162; c=relaxed/simple; bh=ZmC3OjWZl0q+3gq57+LF79x4Ow5OJd8ovTuxBP0F6yk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eFYLTMRqv2rzyvdrEFXNt1zNIfERDRW8oWFqFKroZFrcccV4AVTn6QEg2ItYYa8YA9dzTlUr0EE2ZD46sIybxrfdoDytIm2rVuHlBrEY7En+uJeoYo8BFLfqeckNaQi0Zbf5HtLAeSh/lr1hYOj1seYYIxSv+nnEAHeKmUm/izE= 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=5gnfBC1/; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="5gnfBC1/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713195157; bh=ZmC3OjWZl0q+3gq57+LF79x4Ow5OJd8ovTuxBP0F6yk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=5gnfBC1/qS0oUUqGutXeniQButimzUNYErSz4pcxV+Ti+OMwlBdyNgGAnfGjYgYJx z60yu1BX/dR5adTW7PytjoHmCynODiDyO+P72g0rUey0wUX5jSs2TGC3GnI5Emb4qI rK6XcjKEsuamb4ZgZ7qpmJTo3qLk66qlcT+rLoVWgRYmomCkkvy/DbSsMaSdD+/qZ8 4yoYAtUfMCbCfox+aRkPOotZHjujhfXNU4Ke4MFJGT3jYVe79aEHFb3IBwGkfHVt6D Y05xiv25i1I3cyT265BE4QkuymaiGXPMtaAh+vF6mSgXAixUgzaznUx2aVxpD5qeqL mNJbGG0Al4J9Q== Received: from [192.168.42.226] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B7498378042B; Mon, 15 Apr 2024 15:32:36 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Mon, 15 Apr 2024 11:32:15 -0400 Subject: [PATCH 1/2] selftests: ktap_helpers: Make it POSIX-compliant Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240415-supply-selftest-posix-sh-v1-1-328f008d698d@collabora.com> References: <20240415-supply-selftest-posix-sh-v1-0-328f008d698d@collabora.com> In-Reply-To: <20240415-supply-selftest-posix-sh-v1-0-328f008d698d@collabora.com> To: Shuah Khan Cc: Sebastian Reichel , Mike Looijmans , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.13.0 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" From patchwork Mon Apr 15 15:32:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13630225 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 0809478C78; Mon, 15 Apr 2024 15:32:40 +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=1713195163; cv=none; b=WEo9P1+yxoQneVVww4QkyaEuoMu3tQnCvIz1MAM5eYUzmsmo1CUdawmewKHQzacavey9E2VR5KG/e5XdJikKvW9UafXr7TaSlvIWVHsET7hdEOE3QpFt8P8nuqC4HkQsfI+cf5P6hZnfSXjHtnpEeUiXk0kTwzlMJ7pUs6sFrcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713195163; c=relaxed/simple; bh=0pFnxBdv2Aw+FFWBe7jdyVdRMZ4i1+0Pu9uZ+7wnjz8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pjrH24mKTVqO2PyA2gOjWAo9ugWxEKc+oXBC22FjR/QsP2muoBCrNVRSTgwh5p79KchRwfhLzT2nMcP0lBlVWdfZsmydbk//JLZv+vVtBRffqSS/bQlpuUHucQ/z6vyUNcqiQROoSR6wEC2WwVS1jDBQeCUyieM2UKF3YMW/pTM= 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=c7p6I8OG; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="c7p6I8OG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713195159; bh=0pFnxBdv2Aw+FFWBe7jdyVdRMZ4i1+0Pu9uZ+7wnjz8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=c7p6I8OGVtjkOFs/1NKsBL6gVO0NvGXc7gi16HBlL/v5UpI0gZQZMmPOuPPSWlc9N E7dn6PFZ0pkmgInPQkZcYOpmmyOxPC+yn1eWsBXvDwcmh9K+j2z3kdlSwRp+VdAAvE eI3Asuas45xxr1VP+TXHf73nqR/kE788IK6Spy40iumI72p7iWzDvcfZb5pcvSwA+y aIv38lb7FTuy42cZtmKFgOzOQBBk0jSPMzXFTOpRpO3P7oo9yV+AsMAUX+OZCR01rs lfiiH7tL8pAs9qnL6+uPLeaRg8Pig4fVeccwUV0YNnO739YW3oEwlEWTxf/0BmEjrf bl8kSmDK6WhXQ== Received: from [192.168.42.226] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2E822378201A; Mon, 15 Apr 2024 15:32:38 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Mon, 15 Apr 2024 11:32:16 -0400 Subject: [PATCH 2/2] selftests: power_supply: Make it POSIX-compliant Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240415-supply-selftest-posix-sh-v1-2-328f008d698d@collabora.com> References: <20240415-supply-selftest-posix-sh-v1-0-328f008d698d@collabora.com> In-Reply-To: <20240415-supply-selftest-posix-sh-v1-0-328f008d698d@collabora.com> To: Shuah Khan Cc: Sebastian Reichel , Mike Looijmans , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.13.0 There is one use of bash specific syntax in the script. Change it to the equivalent POSIX syntax. This doesn't change functionality and allows the test to be run on shells other than bash. Reported-by: Mike Looijmans Closes: https://lore.kernel.org/all/efae4037-c22a-40be-8ba9-7c1c12ece042@topic.nl/ Fixes: 4a679c5afca0 ("selftests: Add test to verify power supply properties") Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/power_supply/test_power_supply_properties.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/power_supply/test_power_supply_properties.sh b/tools/testing/selftests/power_supply/test_power_supply_properties.sh index df272dfe1d2a..a66b1313ed88 100755 --- a/tools/testing/selftests/power_supply/test_power_supply_properties.sh +++ b/tools/testing/selftests/power_supply/test_power_supply_properties.sh @@ -23,7 +23,7 @@ count_tests() { total_tests=0 for i in $SUPPLIES; do - total_tests=$(("$total_tests" + "$NUM_TESTS")) + total_tests=$((total_tests + NUM_TESTS)) done echo "$total_tests"