From patchwork Wed Nov 8 11:47:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118241 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5178961qgn; Wed, 8 Nov 2017 03:48:00 -0800 (PST) X-Google-Smtp-Source: ABhQp+SJuWzgvS63A0HaeX6vy5KN5wB0h8pnepBSxZIpttflxyvQNFwdhI29WJuA0dcTpsmqAWCb X-Received: by 10.84.252.141 with SMTP id y13mr188604pll.295.1510141679995; Wed, 08 Nov 2017 03:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510141679; cv=none; d=google.com; s=arc-20160816; b=poMlGnIE3Om8BtObJB9hPCB5hszF9wA0tdZkbAK5QboPCvczrjZTJHEj+8X8H8eV7K lfx/+5No8EqnU87H+izL+lVTddKiYZ4ik3Lr3bfYzivpOJHv/AuFl74vZoIey6jhSeDg o5JByS7hGxSmVyzvN+suL2qT14dqGWYlrcci32ywJDnmgHd6+Mr010bmDUX0u92jWYyI 22i3PBS1Ehw3wN6xP+rIWXcY5j/TmHRzWN2rLHqvOwaJveZBOi2/ZVuERY/3KCrpeRc4 KX/s0zRE7sJA1NFQ2hYGqPxOmSL9kac1/RVmiK/XhFdEZnlP/ENMZbrKY9C6oB+TOqwj tdrA== 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=0LH/LCWXhwhfX7/gwTJAcs3BtVRBH6AvYKxdxU8nRR4=; b=FBZ4doEut8UCpRCXhp7M8RcRhMyrSeMbe952HaJHyUukJm2vZDv835ZTUilQKwE2wd HGXRpihMosthgHiNU3HRXWQOnyzW5Ute1n3rS9rfXryWhqyFg5GxxwILq63a4JMcKrzo KJhx1q9uUXKYz6TcyUdKPIYe0RIVUoTGoHla5QwzqJqnj3fKx2Lvho7AL53STbrThnkr BthfNyxHVrO0UoEkHpzyxL1ut+ROID13KPMmUKnfgQPAQhU+HDl2U77u2CSJEiRHZtJd sD2ctuVoqIAo5bCS8GcLuuAoF966RP6D0jBNh4wzsfd7bKlAqg2krrM3EBqfwYGKkv4d fDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FehUQ13C; 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.47.59; Wed, 08 Nov 2017 03:47:59 -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=FehUQ13C; 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 S1752210AbdKHLr6 (ORCPT + 21 others); Wed, 8 Nov 2017 06:47:58 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:50696 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826AbdKHLrx (ORCPT ); Wed, 8 Nov 2017 06:47:53 -0500 Received: by mail-pg0-f66.google.com with SMTP id y5so1635115pgq.7 for ; Wed, 08 Nov 2017 03:47:53 -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=0LH/LCWXhwhfX7/gwTJAcs3BtVRBH6AvYKxdxU8nRR4=; b=FehUQ13CNAOyyRiSaR3HgadBqjBZTMrcnktByGrTo2srmB1tnLze+i2oAtzRo04pfJ ViXC0pzCP4xERY/TKh+BPODZrcAj+/f6GDhc0l9g4Do8iGYRX90Ghlhwl74H5bM7b10k Br/TXTlpZv7fSime8C+NAo5Ea7yq6p6jrobJ0= 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=0LH/LCWXhwhfX7/gwTJAcs3BtVRBH6AvYKxdxU8nRR4=; b=oFle89gKLTxMq0sge9sFNMDALSxhgr4yNV+gplYxFdZQ9RtuA/f3KsIE1Laxq9VDlO o1m0X6WaubqrHil6lP5anGtvsu5dBtT7msT3ZrHx8gbSAdVsXyYpyuxGN5Mg+MYj7Xuw 04SqxjxOpsjcNUBdvtrwI9VcFndnXTyGdbqyTqYV/zl9Ps7Su/QhisCgEF7gD7zjav// wRyo6O90u5Lqmnyx9OJvR28jxfWOV0wYbLoyoI6Hr5dE9lEe7VmD1SAws1Ls6+kacm/L pMJtI8EIpfO/5npBMdwN6UBUMIK4Xafr68mqbYK2rRW2JWXgMRyOXuWEYk6L/8V5HLMx g/5w== X-Gm-Message-State: AJaThX69JU6I3fymGBR0Kjxzwoi5f/Fgs1j6MVpifcD0FycOLfyR9rXH wonuqtWCTuBgQXcwGbHKYp/0v6a0Pm4= X-Received: by 10.98.217.78 with SMTP id s75mr265312pfg.40.1510141672522; Wed, 08 Nov 2017 03:47:52 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id m74sm8742203pfi.2.2017.11.08.03.47.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 03:47:51 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH 1/2] selftests: firmware: skip unsupported async loading tests Date: Wed, 8 Nov 2017 17:17:39 +0530 Message-Id: <1510141660-31612-2-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 async firmware loading tests on older kernel releases, which do not support this feature. Signed-off-by: Amit Pundir --- tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) -- 2.7.4 Acked-by: Greg Kroah-Hartman 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 supported" >&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 supported" >&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