From patchwork Wed Nov 8 19:40:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118329 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5695782qgn; Wed, 8 Nov 2017 11:40:53 -0800 (PST) X-Google-Smtp-Source: ABhQp+QQ+S40ut5yDyGUh/njnd/iEP0MON2vGYfVMsF7ePBkB5lVazfaKglEEHVN3AsHEXcp+CWT X-Received: by 10.84.245.145 with SMTP id j17mr1368349pll.163.1510170053310; Wed, 08 Nov 2017 11:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510170053; cv=none; d=google.com; s=arc-20160816; b=T+vBC2n2mZQk/umYsqqAEkDvDZ8tUFUcX1pivneh7dkivX/6SFZUPUlqvsYXQhIdZj dVI0/x9ywuHccGMIEYuC8GKzj3O9NVAnH7q6YFV+8KKuEl6TDjFAiEXZtTmtP1EWWTV8 iA6YT0E9H+EOEK7KQsZJ9dJm8eKUCSkXX9b2azmPTRAVDo1WuridF90TQp2nNPN3pA6s m/JpVcGCW8soJUKN+LGOb+f+KNXmlnvcMwR65xSg8bXHmg3qlghVJQTlzVFZ7sGUKO7o FWvRLOVpbEKBEZepnrIXPBPZ7C7Uo/6UGRqKmJYNu55ZKjguujs3GHes8lG6YiH3RZOW w3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:author:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=1FTYM0KxnnPX+70IAA1DUtmOvj9KoHnYWx5DW2Sn3II=; b=qfvX2rawmMCTD5keznnybkDwn9xU2JOL8S5WXEzISnHntdkYCGpdqiBMP1xMmrovsf 19iLbR0DyggrH8YBrq8jn40fYxiCD4M9e4Inlfa1daRhtDu8ojQKVYYgzejMfORJlgRM 8IWbsMQdqhhvrtWFzRfLPSJmvgq1zauA+GkO6f8Eh+vaNw1KuJRK+qP882sXpW0YFEvb BmY1A4Tj4Cwsd2ff6qbpDi92K0Ic5uL9xT0ctJQWqGIWseGCP7Dw4ri1z3yCHQV7YiXs i1+xxuq+MsBej/Mti1/UwCNSNd3EWUxEU660dAgK3Fncq2smguTkpCbwku0FUrqkMCJq MXzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Les4jr4S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21si4981372pfa.266.2017.11.08.11.40.52; Wed, 08 Nov 2017 11:40:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Les4jr4S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752519AbdKHTku (ORCPT + 25 others); Wed, 8 Nov 2017 14:40:50 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46922 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbdKHTkq (ORCPT ); Wed, 8 Nov 2017 14:40:46 -0500 Received: by mail-pf0-f193.google.com with SMTP id p87so2468444pfj.3 for ; Wed, 08 Nov 2017 11:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references:author; bh=1FTYM0KxnnPX+70IAA1DUtmOvj9KoHnYWx5DW2Sn3II=; b=Les4jr4SAR2AlKzYXrW979D0C5/notCB6edBP8L0useb8ksnJtEGs60nO3VaPWEOCL uGK8iaAtbe+RhB22SMMKshbo7ga8JZ72ZWsuwlVCsTdJsJSWjw6UbGMKIXAJ+syvbbRv uIgz72j7dexVebxZ5itLjHGYM1q2k74vhW2dU= 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:author; bh=1FTYM0KxnnPX+70IAA1DUtmOvj9KoHnYWx5DW2Sn3II=; b=Y4lzW8PCAndjrdB0Efvq2kkza7dR+M4a6CwkFvzypfsE73HcfIS9o6mHqNIkHtW46W Z0uGe//bYWiWHNxZrFJV3Rs7XzDsxVvQhQAuu/ZdEjmTcqHerDL/76gELfBdh5Ozu6rh rSW1Ky+RAf2cgW+zFGHj9YOlRNo4a1rxKRxpewg8KgPYX2eCfJ2pgRfZ6/fZXE33K3dI R+JKunV0GeN8b20ARgYOD4dV2IVeLouLcKRetuockNixQGc7IuP+W9ub6SfUm1FXFpyk y1pUQuNxTj61gRZ8vUJaGp112RvZMsXWKFKhC0z+aA9GvL6T/mk340oQZIPiLAZTTcKb qz6w== X-Gm-Message-State: AJaThX4r2v6It0E+36wSdr6Sv470RuLCDCEG3R/DyuzLEdFQNLSQQ/JI H30bjYkrEPB6xy+41KJNVxCsvg== X-Received: by 10.99.117.7 with SMTP id q7mr1469827pgc.382.1510170045763; Wed, 08 Nov 2017 11:40:45 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id j6sm8658143pgn.68.2017.11.08.11.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 11:40:44 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH v2 1/2] selftests: firmware: skip unsupported async loading tests Date: Thu, 9 Nov 2017 01:10:34 +0530 Message-Id: <1510170035-31384-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510170035-31384-1-git-send-email-amit.pundir@linaro.org> References: <1510170035-31384-1-git-send-email-amit.pundir@linaro.org> Author: Amit Pundir Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore async firmware loading tests on older kernel releases, which do not support this feature. Fixes: 1b1fe542b6f0 ("selftests: firmware: add empty string and async tests") Reviewed-by: Sumit Semwal Acked-by: Luis R. Rodriguez Acked-by: Greg Kroah-Hartman Signed-off-by: Amit Pundir --- v2: Changed the display message to make it consistent across all the firmware test scripts. Added Fixes tag. tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index 62f2d6f54929..b1f20fef36c7 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then exit 1 fi -if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then - echo "$0: empty filename should not succeed (async)" >&2 - exit 1 +if [ ! -e "$DIR"/trigger_async_request ]; then + echo "$0: empty filename: async trigger not present, ignoring test" >&2 +else + if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then + echo "$0: empty filename should not succeed (async)" >&2 + exit 1 + fi fi # Request a firmware that doesn't exist, it should fail. @@ -105,17 +109,21 @@ else fi # Try the asynchronous version too -if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then - echo "$0: could not trigger async request" >&2 - exit 1 -fi - -# Verify the contents are what we expect. -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was not loaded (async)" >&2 - exit 1 +if [ ! -e "$DIR"/trigger_async_request ]; then + echo "$0: firmware loading: async trigger not present, ignoring test" >&2 else - echo "$0: async filesystem loading works" + if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then + echo "$0: could not trigger async request" >&2 + exit 1 + fi + + # Verify the contents are what we expect. + if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was not loaded (async)" >&2 + exit 1 + else + echo "$0: async filesystem loading works" + fi fi ### Batched requests tests From patchwork Wed Nov 8 19:40:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118330 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5695814qgn; Wed, 8 Nov 2017 11:40:55 -0800 (PST) X-Google-Smtp-Source: ABhQp+QmPC08g/g1MAR45uvLPLzlLKlEiDKvAtPYpLQHICfMeVfzPgqpkFro1EK+LfjOWYMGsETn X-Received: by 10.99.43.71 with SMTP id r68mr1503121pgr.348.1510170055577; Wed, 08 Nov 2017 11:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510170055; cv=none; d=google.com; s=arc-20160816; b=mwfNN/3meTtQfH08+htmD5D7fK33iaUu6cSsaYyE6R8GPbUZzJ9NU10gyVbpy0j1uk jMtuLTGE49AacC3s/fTpCQCmrzJK3HunNqNJAB1M3/zTG7l1JRzibvBSCWvlvoLAF9kG Gb7ULOpIJLNjCKMR8YQKiiHg9ChJq8MFGKiAivYgu2drLJ3k4lWELIhCMkS+8kDz0pCM OPX14WyCx2vmsJ+mvYrlVzJIuaM4I2njmyMCvRkbsLcF7VvRXNelJlWctoJltPc7KiBk 6at1+q9WmABrH4ePeivu4+1mFcYMc36m55hU89uBuhGwylT3N/2O62w3pVYXgVzVnyW0 HkkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eAFyjUN+956L9fH/V+GlPE/C5+2z6kmt1Y4jFBOMiso=; b=o3tcYRa45uVHcopL5xTKw1xxM4wL8iRE0hRSJYzaY0GRlwipKdzEXh53gz2lgPrkW7 FNzXq9qcIYJXr46gkjWaAInHsGdXkI7URg4GLBSE53aBVmm0NhhHxQXgswJ+gKN3URBR OgccPgR7VVi+S7MjMDFSmLAK48m56rPmp95Me3uXqus2TjJQG+wMhoHhUPwS4O8L9P1y /nZ8uNbEfJ6BG2OG1DFq2Zq6s2N63XUJrCt2amUtzzbbnc3klwluJ+pO0W4xM+zChEjx TsNOL3QrFt5tK9Cj6tuOCUr1WDPUr0Ly3J/b0r+jbW61b3+QkG0OJD5+7+pz8lymeejj +PXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X/aP12Mp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21si4981372pfa.266.2017.11.08.11.40.55; Wed, 08 Nov 2017 11:40:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X/aP12Mp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584AbdKHTkx (ORCPT + 25 others); Wed, 8 Nov 2017 14:40:53 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:47279 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbdKHTku (ORCPT ); Wed, 8 Nov 2017 14:40:50 -0500 Received: by mail-pg0-f67.google.com with SMTP id o7so2698299pgc.4 for ; Wed, 08 Nov 2017 11:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eAFyjUN+956L9fH/V+GlPE/C5+2z6kmt1Y4jFBOMiso=; b=X/aP12Mp0rDSAnP8ZdMGpzznku34CB9E8Y+9VSqasrOgpjYhW3P0tAimb9xgRK0pL7 wajHkzEGaj3hGsJvY/VPNdCMErY0am8rgJs6L4k9Rv1XESVOfS+bjYJ76l900lHrfrha VOqaQXf5+hNxjKVX4H75iyb/RPw2rBMBnxXyg= 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; bh=eAFyjUN+956L9fH/V+GlPE/C5+2z6kmt1Y4jFBOMiso=; b=HHMnRQ+pajgllq0SwXivK0VmTA78kyfT8XuEaR7wYh0UGOYNrM9FJSOg8Wuo82et3S C1m43kbb5nKNQxKUK29X2bkWiVKUc+veBF+7L4XMjF1bUvMdGnpwSZ6dN4DY3uZxsd1S Ui4szPiwMqlbVmjpAvDP/GuVtBCOUfzhoTDAX4cCn3CtMkTFAfLRxKOsZQ5amaKuto5Y JnQ0mcyZ/3wlZHckoDBZvoEJsUeHesGrFmRHV/YoeiExjdcYGF5mQTCQOLf+a74liF56 ehl9mInHJ7gJj6LFLI2ljdGyWSdwmlE7n0MX2HNMohfnz8LFYUYdVb+Oc5TTP4u1X7TL V0Xw== X-Gm-Message-State: AJaThX6g8dxsF37h1nWXQNkqHVEIpPw/QqrqpJ9BnWtitMpvohkmtVUy fVCaivFOAZHtOFpwCiLKSM31Ng== X-Received: by 10.99.120.138 with SMTP id t132mr1502459pgc.88.1510170049519; Wed, 08 Nov 2017 11:40:49 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id j6sm8658143pgn.68.2017.11.08.11.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 11:40:48 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH v2 2/2] selftests: firmware: skip unsupported custom firmware fallback tests Date: Thu, 9 Nov 2017 01:10:35 +0530 Message-Id: <1510170035-31384-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510170035-31384-1-git-send-email-amit.pundir@linaro.org> References: <1510170035-31384-1-git-send-email-amit.pundir@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore custom firmware loading and cancellation tests on older kernel releases, which do not support this feature. Fixes: 061132d2b9c9 ("test_firmware: add test custom fallback trigger") Reviewed-by: Sumit Semwal Acked-by: Luis R. Rodriguez Acked-by: Greg Kroah-Hartman Signed-off-by: Amit Pundir --- v2: Changed the display message to make it consistent across all the firmware test scripts. Added Fixes tag. tools/testing/selftests/firmware/fw_fallback.sh | 38 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh index a52a3bab532b..72858c921eed 100755 --- a/tools/testing/selftests/firmware/fw_fallback.sh +++ b/tools/testing/selftests/firmware/fw_fallback.sh @@ -86,6 +86,11 @@ load_fw_cancel() load_fw_custom() { + if [ ! -e "$DIR"/trigger_custom_fallback ]; then + echo "$0: custom fallback trigger not present, ignoring test" >&2 + return 1 + fi + local name="$1" local file="$2" @@ -108,11 +113,17 @@ load_fw_custom() # Wait for request to finish. wait + return 0 } load_fw_custom_cancel() { + if [ ! -e "$DIR"/trigger_custom_fallback ]; then + echo "$0: canceling custom fallback trigger not present, ignoring test" >&2 + return 1 + fi + local name="$1" local file="$2" @@ -133,6 +144,7 @@ load_fw_custom_cancel() # Wait for request to finish. wait + return 0 } load_fw_fallback_with_child() @@ -227,20 +239,22 @@ else echo "$0: cancelling fallback mechanism works" fi -load_fw_custom "$NAME" "$FW" -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was not loaded" >&2 - exit 1 -else - echo "$0: custom fallback loading mechanism works" +if load_fw_custom "$NAME" "$FW" ; then + if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was not loaded" >&2 + exit 1 + else + echo "$0: custom fallback loading mechanism works" + fi fi -load_fw_custom_cancel "nope-$NAME" "$FW" -if diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was expected to be cancelled" >&2 - exit 1 -else - echo "$0: cancelling custom fallback mechanism works" +if load_fw_custom_cancel "nope-$NAME" "$FW" ; then + if diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was expected to be cancelled" >&2 + exit 1 + else + echo "$0: cancelling custom fallback mechanism works" + fi fi set +e