From patchwork Wed Nov 8 11:47:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118242 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1696338edm; Wed, 8 Nov 2017 03:49:42 -0800 (PST) X-Google-Smtp-Source: ABhQp+S+pAliAbfglK3S0ScSAWGStSncIpqjWXVtkgU9eiSno9A9w/NbNlPCQCF3CXrc/BdhFPGx X-Received: by 10.84.176.131 with SMTP id v3mr219615plb.208.1510141688325; Wed, 08 Nov 2017 03:48:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510141688; cv=none; d=google.com; s=arc-20160816; b=D7kuGHCC/7iHsTYnFC8KSij6A6aF/YPwfcXC914BlSZSrPKhG8HFJWX2OFOovYriP7 0zVqcMa3/7kCv8KiXB33WvSyK0blUg8If9wiuDuywr1pIS2EzO+Fd/KSCHDjA0aCOckH Z6aHXhZT9gN4L3ZiX8L6F61noRexFVE4YzjyaqFONTawhokKEMIxOq196eG0BMosa31d Q6FH66Q5KAAkGNCOtd02bFtWcodA4yNeFPFU8q8iw4K1Yy+x+5pl4ylMsHQY/dfByVRU oe6rQ33rYk1UNefxY3KHghTkrfT5TUEzTugRnYFxSOrEhzMI+Q+dwHpS9AZQ35y7NrPV icoA== 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=JgreyHgHsvahNUV5vbRqVinNFMMrfhe/z4ndpXanHNs=; b=zEVtwTh7j0r+gLiQTvU8WuSnLg7jQnJ1aKfcAJNUKswG+EmGyW2BlbvO3SCyJVSlGs Wdjn2RtrHA2NoSowBPTDMrN/a+7ZRe64ZBODHB33rYEzvuE0c++DQ9vyWmolN62chOQo CM1M8b/sO6ZnOV4gV4zlzmwv5zJVi/qYFpY2BuzP5ShwAQZjdQx+wlfdRAmaYBtRGAkj gx3awyivmC9jHRyS23heJz5vsVLXSJXu89cgdpxIpYOq5F22O9skcZxZk/p9Th5MKFVx jFKL/0LQIXwBk+7G3zUA+v023TLVouW+DM+SG7gGX/0NUpg28akGQxJIF/iCYYjUFMw+ XPXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c9faS8s/; 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 r3si3663916pgn.171.2017.11.08.03.48.08; Wed, 08 Nov 2017 03:48:08 -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=c9faS8s/; 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 S1752250AbdKHLsH (ORCPT + 21 others); Wed, 8 Nov 2017 06:48:07 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46374 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbdKHLr5 (ORCPT ); Wed, 8 Nov 2017 06:47:57 -0500 Received: by mail-pf0-f196.google.com with SMTP id p87so1550695pfj.3 for ; Wed, 08 Nov 2017 03:47:57 -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=JgreyHgHsvahNUV5vbRqVinNFMMrfhe/z4ndpXanHNs=; b=c9faS8s/MZxG26KrMm31YHXqgGtAgGcLFMUPGrDGknfFAAOxHlnga2Gd9rOMrZzV2Q JbAppmxRIW2C2M1juPfX83vZM5jl7gZ43GZKvnYRW6P+aHxSWkPtKtJR7/C273tQgSaS RJIlrM61Tp7YLeHcLbZGLOMOqHPUWYANvgYt4= 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=JgreyHgHsvahNUV5vbRqVinNFMMrfhe/z4ndpXanHNs=; b=a7rR28kXGKlZOOlhAqnXa/7OJDilNvhMza8+jJKjPBX0hRP1MZOZfqMkG95km3ZtEV Dr/cZvy50/sVJJBFDJde60B31PVNbaKTgNZV6djFWA4sKI+4F+KTouAgq0lHFJyw8ZDl 4ssoypO0ryQy50O7+fpM+IhOrghvZbst0ZJfQccCa2o2+X9/VG/50+K97GdpGLI9nLLT k04LsG4wOhRlx5AEWgpeX5tN7YmvB/4R0h3WtB4y+VBwmpu5OLtqB+lePijJVPl9mMqt KWAa6og3JxqhA1yM6Ou8G0hI2eoHsdEH1rQAAIbfeflxHNTv93ORGT6FtNNKYWdqQ65O 8Rig== X-Gm-Message-State: AJaThX79mZRfjR3malJfoLZizmEtvlNaoUds/mNLRUK7V5Bue9KWR3Qo nsr3MLvw4T/9WzkfMYgvjh+RgQ== X-Received: by 10.159.206.193 with SMTP id x1mr190934plo.319.1510141676542; Wed, 08 Nov 2017 03:47:56 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id m74sm8742203pfi.2.2017.11.08.03.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 03:47:55 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests Date: Wed, 8 Nov 2017 17:17:40 +0530 Message-Id: <1510141660-31612-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510141660-31612-1-git-send-email-amit.pundir@linaro.org> References: <1510141660-31612-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 custom firmware loading and cancellation tests on older kernel releases, which do not support this feature. Signed-off-by: Amit Pundir --- tools/testing/selftests/firmware/fw_fallback.sh | 38 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) -- 2.7.4 Acked-by: Greg Kroah-Hartman 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 loading trigger not supported" >&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: cancelling custom fallback trigger not supported" >&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