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